book2mobi (using calibre)
[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,setpagesize=false,urlcolor=black,xetex]{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 \newcommand{\makecover}[2]{
104         \pdfpagewidth=#1
105         \pdfpageheight=#2
106
107         \thispagestyle{empty}
108         \newlength{\PictHOffset}
109         \newlength{\PictVOffset}
110         \setlength{\PictHOffset}{1in}
111         \addtolength{\PictHOffset}{\hoffset}
112         \addtolength{\PictHOffset}{\oddsidemargin}
113
114         \setlength{\PictVOffset}{1in}
115         \addtolength{\PictVOffset}{\voffset}
116         \addtolength{\PictVOffset}{\topmargin}
117         \addtolength{\PictVOffset}{\headheight}
118         \addtolength{\PictVOffset}{\headsep}
119         \addtolength{\PictVOffset}{\topskip}
120         \addtolength{\PictVOffset}{-\pdfpageheight}
121
122         \noindent\hspace*{-\PictHOffset}%
123         \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
124             \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
125         \clearpage
126
127         \setlength{\pdfpagewidth}{210mm}
128         \setlength{\pdfpageheight}{297mm}
129 }
130
131
132 \renewcommand{\maketitle}{
133     {
134     \thispagestyle{empty}
135     \footnotesize
136     \color{theme}
137
138     \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
139         \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
140     \end{minipage}
141     \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
142
143     \ifflaglessadvertising
144     \else
145         \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
146         \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
147         \vspace{.5em}
148     \fi
149
150     Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
151     przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
152
153     \end{minipage}
154     \noindent \rule{\linewidth}{0.4pt}
155
156     \vspace{.6em}
157     \color{black}
158     }
159 }
160
161 \newcommand{\editorialsection}{
162   \begin{figure}[b!]
163   {
164     \footnotesize
165     \color{theme}
166     \noindent \rule{\linewidth}{0.4pt}
167
168     \rightsinfo
169     \vspace{.6em}
170
171     Źródło: \href{\bookurl}{\bookurl}
172
173     \vspace{.6em}
174     \sourceinfo
175
176     \description
177     \vspace{.6em}
178
179     \editors
180
181     \color{black}
182   }
183   \end{figure}
184 }
185
186
187 \newcommand{\typosubsubsection}[1]{%
188 {\textsc{#1}}
189 }
190
191 \newcommand{\typosubsection}[1]{%
192 {\addfontfeature{
193 SizeFeatures={
194   {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
195   {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
196   {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
197 },
198 Letters={Uppercase}
199 }
200 \MakeUppercase{#1}}
201 }
202
203 \newcommand{\typosection}[1]{%
204 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
205 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
206 }
207
208
209 \newcommand{\tytul}[1]{%
210 #1%
211 \vspace{1em}%
212 }
213
214 \newcommand{\nazwapodutworu}[1]{%
215 \section*{\typosection{#1}}%
216 }
217
218 \newcommand{\autorutworu}[1]{%
219 \subsection*{\typosubsection{#1}}%
220 }
221
222 \newcommand{\dzielonadrzedne}[1]{%
223 \subsection*{\typosubsubsection{#1}}%
224 }
225
226 \newcommand{\nazwautworu}[1]{%
227 \section*{\typosection{#1}}%
228 }
229
230 \newcommand{\podtytul}[1]{%
231 \subsection*{\typosubsubsection{#1}}%
232 }
233
234 \newcommand{\translator}[1]{%
235 \subsection*{\typosubsubsection{tłum. #1}}%
236 }
237
238
239 \newcommand{\powiesc}[1]{#1}
240 \newcommand{\opowiadanie}[1]{#1}
241 \newcommand{\lirykal}[1]{#1}
242 \newcommand{\lirykalp}[1]{#1}
243 \newcommand{\dramatwierszowanyl}[1]{#1}
244 \newcommand{\dramatwierszowanylp}[1]{#1}
245 \newcommand{\dramatwspolczesny}[1]{#1}
246
247 \newcommand{\nota}[1]{%
248 \par{#1}%
249 }
250
251 \newcommand{\dedykacja}[1]{%
252 \begin{em}%
253 \begin{flushright}%
254 #1%
255 \end{flushright}%
256 \end{em}%
257 }
258
259 \newcommand{\dlugicytat}[1]{%
260 \begin{quotation}%
261 #1%
262 \end{quotation}%
263 }
264
265 \newcommand{\poezjacyt}[1]{%
266 \begin{verse}%
267 #1%
268 \end{verse}%
269 }
270 \newcommand{\motto}[1]{%
271 \begin{em}%
272 #1%
273 \end{em}%
274 }
275 \newcommand{\listaosob}[2]{%
276 \par{#1}%
277 \begin{itemize}%
278 #2%
279 \end{itemize}%
280 }
281
282 \newcommand{\nagloweklisty}[1]{%
283 \typosubsubsection{#1}%
284 }
285
286 \newcommand{\listaosoba}[1]{%
287 \item{#1}%
288 }
289
290 \newcommand{\kwestia}[1]{%
291 \par{#1}%
292 }
293
294 \newcommand{\naglowekakt}[1]{%
295 \pagebreak
296 \subsection*{\typosubsection{#1}}%
297 }
298 \newcommand{\naglowekczesc}[1]{%
299 \pagebreak
300 \subsection*{\typosubsection{#1}}%
301 }
302 \newcommand{\srodtytul}[1]{%
303 \subsection*{\typosubsection{#1}}%
304 }
305
306 \newcommand{\naglowekscena}[1]{%
307 \subsubsection*{\typosubsubsection{#1}}%
308 }
309 \newcommand{\naglowekrozdzial}[1]{%
310 \subsubsection*{\typosubsubsection{#1}}%
311 }
312
313 \newcommand{\naglowekosoba}[1]{%
314 \par{\textsc{#1}}\nopagebreak%
315 }
316 \newcommand{\naglowekpodrozdzial}[1]{%
317 \par{#1}\nopagebreak%
318 }
319
320 \newcommand{\miejsceczas}[1]{%
321 \par{\emph{#1}}%
322 }
323 \newcommand{\didaskalia}[1]{%
324 \par{\emph{#1}}%
325 }
326
327 \newcommand{\akap}[1]{%
328 \par{#1}%
329 }
330 \newcommand{\akapdialog}[1]{%
331 \par{#1}%
332 }
333 \newcommand{\akapcd}[1]{%
334 \par{#1}%
335 }
336
337 \newcommand{\mottopodpis}[1]{%
338 \begin{em}%
339 \begin{flushright}%
340 #1%
341 \end{flushright}%
342 \end{em}%
343 }
344
345 \newcommand{\strofa}[1]{%
346 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
347 }
348
349 \newcommand{\wers}[1]{#1}
350
351 \newcommand{\wersakap}[1]{%
352 \hspace*{1em}#1%
353 }
354 \newcommand{\werscd}[1]{%
355 \hspace*{8em}#1%
356 }
357 \newcommand{\werswciety}[2][1em]{%
358 \hspace*{#1}#2%
359 }
360
361
362 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
363 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
364 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
365 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
366
367 \newcommand{\mat}[1]{$#1$}
368
369 \newcommand{\didasktekst}[1]{%
370 \emph{#1}%
371 }
372 \newcommand{\slowoobce}[1]{%
373 \emph{#1}%
374 }
375 \newcommand{\tytuldziela}[1]{%
376 \emph{#1}%
377 }
378 \newcommand{\wyroznienie}[1]{%
379 \emph{#1}%
380 }
381
382 \newcommand{\osoba}[1]{%
383 #1%
384 }
385
386 \newcommand{\sekcjaswiatlo}{%
387 \vspace{30pt}%
388 }
389
390 \newcommand{\sekcjaasterysk}{%
391 \vspace{10pt}%
392 \begin{center}%
393 \par{*}%
394 \end{center}%
395 }
396
397 \newcommand{\separatorlinia}{%
398 \vspace{10pt}%
399 \hrule{}%
400 \vspace{10pt}%
401 }
402
403 \newcommand{\motyw}[2][0]{%
404 \mbox{}%
405 \marginpar{%
406 \vspace{-8pt}%
407 \vspace{-#1\baselineskip}%
408 \raggedright{\hspace{0pt}%
409 \footnotesize{\color{theme}{#2}}}%
410 \vspace{\baselineskip}%
411 }%
412 }
413