okładka cd
[librarian.git] / librarian / pdf / wl.cls
1 % -*- coding: utf-8 -*-
2 \NeedsTeXFormat{LaTeX2e}
3 \ProvidesClass{wl}[2011/11/28 wolnelektury.pl book style]
4
5 % PDF customizations
6 %
7 % nofootnotes - disable generation of footnotes
8 % nothemes - disable generation of themes
9 % defaultleading - default leading
10 % onehalfleading - leading of 1.5 (interlinia)
11 % doubleleading - double leading (interlinia)
12 % a4paper,... - paper size as required by LaTeX
13 % nowlfont - don't use customized WL font
14
15 \RequirePackage{setspace}
16 \RequirePackage{type1cm}
17 \RequirePackage{amssymb}
18 \RequirePackage{amsmath}
19 \DeclareOption{13pt}{%
20 \AtEndOfClass{%
21 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
22 \renewcommand\normalsize{%
23    \@setfontsize\normalsize{13pt}{14.5pt}%
24    \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
25    \abovedisplayshortskip \z@ \@plus3\p@
26    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
27    \belowdisplayskip \abovedisplayskip
28    \let\@listi\@listI}\normalsize%
29 \renewcommand\footnotesize{%
30    \@setfontsize\footnotesize\@xpt\@xiipt
31    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
32    \abovedisplayshortskip \z@ \@plus3\p@
33    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
34    \def\@listi{\leftmargin\leftmargini
35                \topsep 6\p@ \@plus2\p@ \@minus2\p@
36                \parsep 3\p@ \@plus2\p@ \@minus\p@
37                \itemsep \parsep}%
38    \belowdisplayskip \abovedisplayskip
39 }%
40 }%
41 }
42
43 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
44
45 \DeclareOption{defaultleading}{}
46 \DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
47 \DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
48
49 %% This does not really work, since dvipdfm(x) will use it's configuration in /etc/texmf/dvipdfm(x) and force a global paper size setting.
50 \DeclareOption{a5paper}{%
51       \setlength{\paperheight}{210mm}%
52       \setlength{\paperwidth}{148mm}}
53
54
55 \newif\ifshowfootnotes \showfootnotestrue
56 \DeclareOption{nofootnotes}{\showfootnotesfalse}
57
58 \newif\ifshowthemes \showthemestrue
59 \DeclareOption{nothemes}{\showthemesfalse}
60
61 \newif\ifenablewlfont \enablewlfonttrue
62 \DeclareOption{nowlfont}{\enablewlfontfalse}
63
64 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
65 \ProcessOptions\relax
66 \LoadClass[a4paper]{book}
67
68
69 \usepackage{trace}
70 \usepackage{caption}
71 \usepackage{tabularx}
72 \usepackage[MeX]{polski}
73 \usepackage{icomma}
74 \usepackage[xetex]{graphicx}
75 \usepackage{fontspec}
76 \usepackage{xunicode}
77 \usepackage{xltxtra}
78
79
80 \usepackage[overload]{textcase}
81 \usepackage{scalefnt}
82 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
83
84 \ifenablewlfont
85 \setmainfont [
86 %ExternalLocation,
87 UprightFont = JunicodeWL-Regular,
88 ItalicFont = JunicodeWL-Italic,
89 BoldFont = JunicodeWL-Regular,
90 BoldItalicFont = JunicodeWL-Italic,
91 SmallCapsFont = JunicodeWL-Regular,
92 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
93 Numbers=OldStyle,
94 Scale=1.04,
95 LetterSpace=-1.0
96 ] {JunicodeWL}
97
98 \newfontfamily\alien[
99 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
100 Numbers=OldStyle,
101 Scale=0.85,
102 LetterSpace=-1.0
103 ] {DejaVu Serif}
104
105
106 \defaultfontfeatures{
107 SizeFeatures={
108   {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
109   {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
110   {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
111 }
112 }
113
114 \renewcommand{\textsc}[1]{%
115 {\addfontfeature{
116 SizeFeatures={
117   {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
118   {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
119   {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
120 },
121 Letters={SmallCaps,UppercaseSmallCaps}
122 }
123 #1}
124 }
125 \fi% enablewlfont
126
127 %{\Itshape JunicodeWL-Italic.ttf }
128 %{\bfseries Junicode-Bold.ttf }
129 %{\bfseries\itshape Junicode-BoldItalic.ttf }
130
131 \pagestyle{plain}
132 \usepackage{fancyhdr}
133
134 \makeatletter
135
136 % bottom figure below footnotes
137 \usepackage{fnpos}
138 \makeFNabove
139
140 \usepackage{color}
141 \definecolor{theme}{gray}{.3}
142
143 \setlength{\marginparsep}{2em}
144 \setlength{\marginparwidth}{8.5em}
145 \setlength{\oddsidemargin}{36mm}
146 \setlength{\evensidemargin}{0pt}
147 \setlength{\voffset}{0pt}
148 \setlength{\topmargin}{0pt}
149 \setlength{\headheight}{0pt}
150 \setlength{\headsep}{0pt}
151 \setlength{\textheight}{24cm}
152
153 \pagestyle{fancy}
154 \fancyhf{}
155 \renewcommand{\headrulewidth}{0pt}
156 \renewcommand{\footrulewidth}{0pt}
157
158 %\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
159 \cfoot{}
160 %\rfoot{{\footnotesize \thepage}}
161 \fancyfoot[LO,RE]{{\footnotesize \textsc{\@author} \emph{\@title}}}
162 \fancyfoot[LE,RO]{{\footnotesize \thepage}}
163
164 \clubpenalty=100000
165 \widowpenalty=100000
166
167
168 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
169 \newsavebox{\ximagebox}\newlength{\ximageheight}
170 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
171 \newcommand{\xbox}[1]
172 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
173 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
174 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
175 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
176 \usebox{\ximagebox}%
177 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
178
179 \newcommand{\makecover}[2]{
180
181
182         %\pdfpagewidth=#1
183         %\pdfpageheight=#2
184
185         \thispagestyle{empty}
186         \newlength{\PictHOffset}
187         \newlength{\PictVOffset}
188         \setlength{\PictHOffset}{1in}
189         \addtolength{\PictHOffset}{\hoffset}
190         \addtolength{\PictHOffset}{\oddsidemargin}
191
192         \setlength{\PictVOffset}{1in}
193         \addtolength{\PictVOffset}{\voffset}
194         \addtolength{\PictVOffset}{\topmargin}
195         \addtolength{\PictVOffset}{\headheight}
196         \addtolength{\PictVOffset}{\headsep}
197         \addtolength{\PictVOffset}{\topskip}
198
199         \addtolength{\PictVOffset}{-#2}
200
201         \noindent\hspace*{-\PictHOffset}%
202         \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
203             \includegraphics[height=#2,width=#1]{cover.jpg}}}
204         %\clearpage
205         \vspace{#2}
206
207         \hspace{-36mm}\parbox{16cm}{
208         {\addfontfeature{LetterSpace=-4.0}\emph{\scalefont{4}%
209             \noindent Philippe Aigrain
210         }}
211
212         \vspace{2em}
213         {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
214             Dzielenie się
215         }}
216
217
218         \vspace{8em}
219
220 %\emph{\thankyou}\\
221 %\indent\emph{You made this book possible.}
222         }
223
224
225         %\setlength{\pdfpagewidth}{210mm}
226         %\setlength{\pdfpageheight}{297mm}
227 }
228
229
230 \renewcommand{\maketitle}{
231     {
232     \thispagestyle{empty}
233     \footnotesize
234     \color{theme}
235
236     \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
237         \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
238     \end{minipage}
239     \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
240
241     \ifflaglessadvertising
242     \else
243         \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
244         \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
245         \vspace{.5em}
246     \fi
247
248     Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
249     przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
250
251     \end{minipage}
252     \noindent \rule{\linewidth}{0.4pt}
253
254     \vspace{.6em}
255     \color{black}
256     }
257 }
258
259 \usepackage{printlen}
260
261 \newcommand{\editorialsection}{
262 \clearpage
263
264 %\set\textwidth=450pt
265 %\printlength\textwidth
266
267
268 {\scalefont{1.5}Drogi czytelniku!}
269
270
271
272 \vspace{1em}
273
274 \vspace{1em}
275 Zespół Fundacji Nowoczesna Polska
276
277 \vspace{4em}
278 \includegraphics[scale=.2]{logo.eps}
279 \vspace{1em}
280
281 \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
282
283 %\vspace{4em}
284 %\box{\tableofcontents}
285
286   \begin{figure}[b!]
287   {
288     \footnotesize
289     \color{theme}
290     \noindent \rule{\linewidth}{0.4pt}
291
292     \rightsinfo
293     \vspace{.6em}
294
295     %Źródło: \href{\bookurl}{\bookurl}
296
297     %\vspace{.6em}
298     %\sourceinfo
299
300     %\description
301     %\vspace{.6em}
302
303     Opublikowano przez \href{http://nowoczesnapolska.org.pl}{Fundację Nowoczesna Polska}, 2012.
304
305     \editors
306
307     %\vspace{.6em}
308     \coverby
309
310     \color{black}
311   }
312   \end{figure}
313 }
314
315
316 \newcommand{\typosubsubsection}[1]{%
317 {\textsc{#1}}
318 }
319
320 \newcommand{\typosubsection}[1]{%
321 {\addfontfeature{
322 SizeFeatures={
323   {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
324   {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
325   {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
326 },
327 Letters={Uppercase}
328 }
329 \MakeUppercase{#1}}
330 }
331
332 \newcommand{\typosection}[1]{%
333 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
334 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
335 }
336
337 \newcommand{\tytul}[1]{%
338 #1%
339 %\vspace{1em}%
340 }
341
342 \newcommand{\autorpodutworu}[1]{%
343 \section*{\typosection{#1}}%
344 }
345
346 \newcommand{\nazwapodutworu}[1]{%
347 \section*{\typosection{#1}}%
348 }
349
350 \newcommand{\autorutworu}[1]{%
351 \addcontentsline{toc}{part}{???}
352 \subsection*{\typosubsection{#1}}%
353 }
354
355 \newcommand{\dzielonadrzedne}[1]{%
356 \subsection*{\typosubsubsection{#1}}%
357 }
358
359 \newcommand{\nazwautworu}[1]{%
360 \section*{\typosection{#1}}%
361 }
362
363 \newcommand{\podtytul}[1]{%
364 \subsection*{\typosubsubsection{#1}}%
365 }
366
367 \newcommand{\podtytulpodutworu}[1]{%
368 \subsection*{\typosubsubsection{#1}}%
369 }
370
371 \newcommand{\translator}[1]{%
372 \subsection*{\typosubsubsection{tłum. #1}}%
373 }
374
375 \newcommand{\powiesc}[1]{#1}
376 \newcommand{\opowiadanie}[1]{#1}
377 \newcommand{\lirykal}[1]{#1}
378 \newcommand{\lirykalp}[1]{#1}
379 \newcommand{\dramatwierszowanyl}[1]{#1}
380 \newcommand{\dramatwierszowanylp}[1]{#1}
381 \newcommand{\dramatwspolczesny}[1]{#1}
382
383 \newcommand{\nota}[1]{%
384 \begin{quotation}%
385 #1%
386 \end{quotation}%
387 }
388
389 \newcommand{\dedykacja}[1]{%
390 \begin{em}%
391 \begin{flushright}%
392 #1%
393 \end{flushright}%
394 \end{em}%
395 }
396
397 \newcommand{\dlugicytat}[1]{%
398 \begin{quotation}%
399 #1%
400 \end{quotation}%
401 }
402
403 \newcommand{\poezjacyt}[1]{%
404 \begin{verse}%
405 #1%
406 \end{verse}%
407 }
408 \newcommand{\motto}[1]{%
409 \begin{em}%
410 #1%
411 \end{em}%
412 }
413 \newcommand{\listaosob}[2]{%
414 \par{#1}%
415 \begin{itemize}%
416 #2%
417 \end{itemize}%
418 }
419
420 \newcommand{\nagloweklisty}[1]{%
421 \typosubsubsection{#1}%
422 }
423
424 \newcommand{\listaosoba}[1]{%
425 \item{#1}%
426 }
427
428 \newcommand{\kwestia}[1]{%
429 \par{#1}%
430 }
431
432 \newcommand{\naglowekakt}[1]{%
433 \pagebreak
434 \subsection*{\typosubsection{#1}}%
435 }
436 \newcommand{\naglowekczesc}[1]{%
437 %\pagebreak
438 \subsection*{\typosubsection{#1}}%
439 }
440 \newcommand{\srodtytul}[1]{%
441 \subsection*{\typosubsection{#1}}%
442 }
443
444 \newcommand{\naglowekscena}[1]{%
445 \subsubsection*{\typosubsubsection{#1}}%
446 }
447 \newcommand{\naglowekrozdzial}[1]{%
448 \subsubsection*{\typosubsubsection{#1}}%
449 }
450
451 \newcommand{\naglowekosoba}[1]{%
452 \par{\textsc{#1}}\nopagebreak%
453 }
454 \newcommand{\naglowekpodrozdzial}[1]{%
455 \par{#1}\nopagebreak%
456 }
457
458 \newcommand{\miejsceczas}[1]{%
459 \par{\emph{#1}}%
460 }
461 \newcommand{\didaskalia}[1]{%
462 \par{\emph{#1}}%
463 }
464
465 \newcommand{\akap}[1]{%
466 \par{#1}%
467 }
468 \newcommand{\akapdialog}[1]{%
469 \par{#1}%
470 }
471 \newcommand{\akapcd}[1]{%
472 \par{#1}%
473 }
474
475 \newcommand{\mottopodpis}[1]{%
476 \begin{em}%
477 \begin{flushright}%
478 #1%
479 \end{flushright}%
480 \end{em}%
481 }
482
483 \newcommand{\strofa}[1]{%
484 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
485 }
486
487 \newcommand{\wers}[1]{#1}
488
489 \newcommand{\wersakap}[1]{%
490 \hspace*{1em}#1%
491 }
492 \newcommand{\werscd}[1]{%
493 \hspace*{8em}#1%
494 }
495 \newcommand{\werswciety}[2][1em]{%
496 \hspace*{#1}#2%
497 }
498
499 \ifshowfootnotes
500   \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
501   \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
502   \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
503   \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
504 \else
505   \newcommand{\pa}[1]{}
506   \newcommand{\pe}[1]{}
507   \newcommand{\pr}[1]{}
508   \newcommand{\pt}[1]{}
509 \fi
510
511 \newcommand{\mat}[1]{$#1$}
512
513 \newcommand{\didasktekst}[1]{%
514 \emph{#1}%
515 }
516 \newcommand{\slowoobce}[1]{%
517 \emph{#1}%
518 }
519 \newcommand{\tytuldziela}[1]{%
520 \emph{#1}%
521 }
522 \newcommand{\wyroznienie}[1]{%
523 \emph{#1}%
524 }
525
526 \newcommand{\osoba}[1]{%
527 #1%
528 }
529
530 \newcommand{\sekcjaswiatlo}{%
531 \vspace{30pt}%
532 }
533
534 \newcommand{\sekcjaasterysk}{%
535 \vspace{10pt}%
536 \begin{center}%
537 \par{*}%
538 \end{center}%
539 \noindent%
540 }
541
542 \newcommand{\separatorlinia}{%
543 \vspace{10pt}%
544 \hrule{}%
545 \vspace{10pt}%
546 }
547
548 \newcommand{\motyw}[2][0]{%
549 \ifshowthemes
550 \mbox{}%
551 \marginpar{%
552 \vspace{-8pt}%
553 \vspace{-#1\baselineskip}%
554 \raggedright{\hspace{0pt}%
555 \footnotesize{\color{theme}{#2}}}%
556 \vspace{\baselineskip}%
557 }%
558 \fi
559 }
560
561 \newcommand{\ilustr}[2]{
562
563 \vspace{1em}%
564 \begin{center}%
565 \par{\includegraphics[width=\textwidth]{#1}\\#2}%
566 \end{center}%
567 \vspace{1em}%
568 }