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