#1030: fixes for separators and empty verses in html, epub, pdf
[librarian.git] / librarian / pdf / wl.sty
1 % -*- coding: utf-8 -*-
2
3 \usepackage[MeX]{polski}
4
5 \usepackage[xetex]{graphicx}
6 \usepackage{fontspec}
7 \usepackage{xunicode}
8 \usepackage{xltxtra}
9
10 \usepackage[overload]{textcase}
11 \usepackage{scalefnt}
12 \usepackage[colorlinks=true,linkcolor=black,urlcolor=black]{hyperref}
13
14 \setmainfont [
15 %ExternalLocation,
16 UprightFont = JunicodeWL-Regular,
17 ItalicFont = JunicodeWL-Italic,
18 BoldFont = JunicodeWL-Regular,
19 BoldItalicFont = JunicodeWL-Italic,
20 SmallCapsFont = JunicodeWL-Regular,
21 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
22 Numbers=OldStyle,
23 Scale=1.04,
24 LetterSpace=-1.0
25 ] {JunicodeWL}
26
27 \newfontfamily\alien[
28 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
29 Numbers=OldStyle,
30 Scale=0.85,
31 LetterSpace=-1.0
32 ] {DejaVu Serif}
33
34
35 \defaultfontfeatures{
36 SizeFeatures={
37   {Size={-10}, FakeStretch=1.02, LetterSpace=2.0 },
38   {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
39   {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
40 }
41 }
42
43 \renewcommand{\textsc}[1]{%
44 {\addfontfeature{
45 SizeFeatures={
46   {Size={-10}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
47   {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
48   {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
49 },
50 Letters={SmallCaps,UppercaseSmallCaps}
51 }
52 #1}
53 }
54
55 %{\itshape JunicodeWL-Italic.ttf }
56 %{\bfseries Junicode-Bold.ttf }
57 %{\bfseries\itshape Junicode-BoldItalic.ttf }
58
59 \pagestyle{plain}
60 \usepackage{fancyhdr}
61
62 \makeatletter
63
64 % bottom figure below footnotes
65 \usepackage{fnpos}
66 \makeFNabove
67
68 \usepackage{color}
69 \definecolor{theme}{gray}{.3}
70
71 \setlength{\marginparsep}{2em}
72 \setlength{\marginparwidth}{8.5em}
73 \setlength{\oddsidemargin}{0pt}
74 \setlength{\voffset}{0pt}
75 \setlength{\topmargin}{0pt}
76 \setlength{\headheight}{0pt}
77 \setlength{\headsep}{0pt}
78 \setlength{\textheight}{24cm}
79
80 \pagestyle{fancy}
81 \fancyhf{}
82 \renewcommand{\headrulewidth}{0pt}
83 \renewcommand{\footrulewidth}{0pt}
84 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
85 \cfoot{}
86 \rfoot{{\footnotesize \thepage}}
87
88 \clubpenalty=100000
89 \widowpenalty=100000
90
91
92 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
93 \newsavebox{\ximagebox}\newlength{\ximageheight}
94 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
95 \newcommand{\xbox}[1]
96 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
97 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
98 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
99 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
100 \usebox{\ximagebox}%
101 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
102
103
104 \renewcommand{\maketitle}{
105     {
106     \thispagestyle{empty}
107     \footnotesize
108     \color{theme}
109
110     \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
111         \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
112     \end{minipage}
113     \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
114         Na podstawie: \sourceinfo
115
116         \vspace{.5em}
117
118         Wersja lektury on-line dostępna jest \href{\bookurl}{na stronie wolnelektury.pl}.
119         \vspace{.5em}
120
121         \rightsinfo
122
123         \vspace{.6em}
124
125     \end{minipage}
126     \noindent \rule{\linewidth}{0.4pt}
127
128     \vspace{.6em}
129     \color{black}
130
131 %    \begin{figure}[b!]
132 %        \footnotesize
133 %        \color{theme}
134 %        \noindent \rule{\linewidth}{0.4pt}
135
136 %        Szkolna biblioteka internetowa Wolne Lektury tworzona jest dzięki pracy Wolontariuszy, ale to osoby
137 %        zatrudnione w~FNP będą musiały wymyślić, co powinno zostać napisane w~tym miejscu. Można zupełnie usunąć
138 %        tę sekcję, ale autor konwertera chciał się popisać, że umie coś takiego zrobić.
139 %        \color{black}
140 %    \end{figure}
141     }
142 }
143
144 \newcommand{\typosubsubsection}[1]{%
145 {\textsc{#1}}
146 }
147
148 \newcommand{\typosubsection}[1]{%
149 {\addfontfeature{
150 SizeFeatures={
151   {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
152   {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
153   {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
154 },
155 Letters={Uppercase}
156 }
157 \MakeUppercase{#1}}
158 }
159
160 \newcommand{\typosection}[1]{%
161 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
162 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
163 }
164
165 \newcommand{\nazwapodutworu}[1]{%
166 \section*{\typosection{#1}}%
167 }
168
169 \newcommand{\autorutworu}[1]{%
170 \subsection*{\typosubsection{#1}}%
171 }
172
173 \newcommand{\nazwautworu}[1]{%
174 \section*{\typosection{#1}}%
175 }
176
177 \newcommand{\podtytul}[1]{%
178 \subsection*{\typosubsection{#1}}%
179 }
180
181 \newcommand{\powiesc}[1]{#1}
182 \newcommand{\opowiadanie}[1]{#1}
183 \newcommand{\lirykal}[1]{#1}
184 \newcommand{\lirykalp}[1]{#1}
185 \newcommand{\dramatwierszowanyl}[1]{#1}
186 \newcommand{\dramatwierszowanylp}[1]{#1}
187 \newcommand{\dramatwspolczesny}[1]{#1}
188
189 \newcommand{\nota}[1]{%
190 \par{#1}%
191 }
192
193 \newcommand{\dedykacja}[1]{%
194 \begin{em}%
195 \begin{flushright}%
196 #1%
197 \end{flushright}%
198 \end{em}%
199 }
200
201 \newcommand{\dlugicytat}[1]{%
202 \begin{quotation}%
203 #1%
204 \end{quotation}%
205 }
206
207 \newcommand{\poezjacyt}[1]{%
208 \begin{verse}%
209 #1%
210 \end{verse}%
211 }
212 \newcommand{\motto}[1]{%
213 \begin{em}%
214 #1%
215 \end{em}%
216 }
217 \newcommand{\listaosob}[2]{%
218 \par{#1}%
219 \begin{itemize}%
220 #2%
221 \end{itemize}%
222 }
223
224 \newcommand{\nagloweklisty}[1]{%
225 \typosubsubsection{#1}%
226 }
227
228 \newcommand{\listaosoba}[1]{%
229 \item{#1}%
230 }
231
232 \newcommand{\kwestia}[1]{%
233 \par{#1}%
234 }
235
236 \newcommand{\naglowekakt}[1]{%
237 \pagebreak
238 \subsection*{\typosubsection{#1}}%
239 }
240 \newcommand{\naglowekczesc}[1]{%
241 \pagebreak
242 \subsection*{\typosubsection{#1}}%
243 }
244 \newcommand{\srodtytul}[1]{%
245 \subsection*{\typosubsection{#1}}%
246 }
247
248 \newcommand{\naglowekscena}[1]{%
249 \subsubsection*{\typosubsubsection{#1}}%
250 }
251 \newcommand{\naglowekrozdzial}[1]{%
252 \subsubsection*{\typosubsubsection{#1}}%
253 }
254
255 \newcommand{\naglowekosoba}[1]{%
256 \par{\textsc{#1}}\nopagebreak%
257 }
258 \newcommand{\naglowekpodrozdzial}[1]{%
259 \par{#1}\nopagebreak%
260 }
261
262 \newcommand{\miejsceczas}[1]{%
263 \par{\emph{#1}}%
264 }
265 \newcommand{\didaskalia}[1]{%
266 \par{\emph{#1}}%
267 }
268
269 \newcommand{\akap}[1]{%
270 \par{#1}%
271 }
272 \newcommand{\akapdialog}[1]{%
273 \par{#1}%
274 }
275 \newcommand{\akapcd}[1]{%
276 \par{#1}%
277 }
278
279 \newcommand{\mottopodpis}[1]{%
280 \begin{em}%
281 \begin{flushright}%
282 #1%
283 \end{flushright}%
284 \end{em}%
285 }
286
287 \newcommand{\strofa}[1]{%
288 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
289 }
290
291 \newcommand{\wers}[1]{#1}
292
293 \newcommand{\wersakap}[1]{%
294 \hspace*{1em}#1%
295 }
296 \newcommand{\werscd}[1]{%
297 \hspace*{8em}#1%
298 }
299 \newcommand{\werswciety}[2][1em]{%
300 \hspace*{#1}#2%
301 }
302
303
304 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1}}}
305 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
306 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
307 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
308
309 \newcommand{\mat}[1]{$#1$}
310
311 \newcommand{\didasktekst}[1]{%
312 \emph{#1}%
313 }
314 \newcommand{\slowoobce}[1]{%
315 \emph{#1}%
316 }
317 \newcommand{\tytuldziela}[1]{%
318 \emph{#1}%
319 }
320 \newcommand{\wyroznienie}[1]{%
321 \emph{#1}%
322 }
323
324 \newcommand{\osoba}[1]{%
325 #1%
326 }
327
328 \newcommand{\sekcjaswiatlo}{%
329 \vspace{30pt}%
330 }
331
332 \newcommand{\sekcjaasterysk}{%
333 \vspace{10pt}%
334 \begin{center}%
335 \par{*}%
336 \end{center}%
337 }
338
339 \newcommand{\separatorlinia}{%
340 \vspace{10pt}%
341 \hrule{}%
342 \vspace{10pt}%
343 }
344
345 \newcommand{\motyw}[2][0]{%
346 \mbox{}%
347 \marginpar{%
348 \vspace{-8pt}%
349 \vspace{-#1\baselineskip}%
350 \raggedright{\hspace{0pt}%
351 \footnotesize{\color{theme}{#2}}}%
352 \vspace{\baselineskip}%
353 }%
354 }
355