Legimi cover classes.
[librarian.git] / src / 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{fixltx2e}
16 \RequirePackage{setspace}
17 \RequirePackage{type1cm}
18 \DeclareOption{13pt}{%
19 \AtEndOfClass{%
20 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
21 \renewcommand\normalsize{%
22    \@setfontsize\normalsize{13pt}{14.5pt}%
23    \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
24    \abovedisplayshortskip \z@ \@plus3\p@
25    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
26    \belowdisplayskip \abovedisplayskip
27    \let\@listi\@listI}\normalsize%
28 \renewcommand\footnotesize{%
29    \@setfontsize\footnotesize\@xpt\@xiipt
30    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
31    \abovedisplayshortskip \z@ \@plus3\p@
32    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
33    \def\@listi{\leftmargin\leftmargini
34                \topsep 6\p@ \@plus2\p@ \@minus2\p@
35                \parsep 3\p@ \@plus2\p@ \@minus\p@
36                \itemsep \parsep}%
37    \belowdisplayskip \abovedisplayskip
38 }%
39 }%
40 }
41 \DeclareOption{16pt}{%
42 \AtEndOfClass{%
43 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
44 \renewcommand\normalsize{%
45    \@setfontsize\normalsize{16pt}{18pt}%
46    \abovedisplayskip 15\p@ \@plus3\p@ \@minus7\p@
47    \abovedisplayshortskip \z@ \@plus3.5\p@
48    \belowdisplayshortskip 8\p@ \@plus4\p@ \@minus3\p@
49    \belowdisplayskip \abovedisplayskip
50    \let\@listi\@listI}\normalsize%
51 \renewcommand\footnotesize{%
52    \@setfontsize\footnotesize\@xpt\@xiipt
53    \abovedisplayskip 12\p@ \@plus2\p@ \@minus5\p@
54    \abovedisplayshortskip \z@ \@plus3.5\p@
55    \belowdisplayshortskip 7\p@ \@plus3.5\p@ \@minus3\p@
56    \def\@listi{\leftmargin\leftmargini
57                \topsep 7\p@ \@plus2.5\p@ \@minus2.5\p@
58                \parsep 3.5\p@ \@plus2.5\p@ \@minus\p@
59                \itemsep \parsep}%
60    \belowdisplayskip \abovedisplayskip
61 }%
62 }%
63 }
64
65 \newif\iflargefont
66 \largefontfalse
67
68 \DeclareOption{26pt}{%
69 \largefonttrue
70 \AtEndOfClass{%
71 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
72 \renewcommand\normalsize{%
73    \@setfontsize\normalsize{26pt}{31pt}%
74    \abovedisplayskip 14\p@ \@plus6\p@ \@minus14\p@
75    \abovedisplayshortskip \z@ \@plus6\p@
76    \belowdisplayshortskip 13\p@ \@plus7\p@ \@minus6\p@
77    \belowdisplayskip \abovedisplayskip
78    \let\@listi\@listI}\normalsize%
79    \setlength{\parindent}{1.5em}%
80 \renewcommand\footnotesize{%
81    \@setfontsize\footnotesize{15pt}{20pt}
82    \abovedisplayskip 20\p@ \@plus4\p@ \@minus10\p@
83    \abovedisplayshortskip \z@ \@plus6\p@
84    \belowdisplayshortskip 12\p@ \@plus6\p@ \@minus6\p@
85    \def\@listi{\leftmargin\leftmargini
86                \topsep 12\p@ \@plus4\p@ \@minus4\p@
87                \parsep 6\p@ \@plus4\p@ \@minus\p@
88                \itemsep \parsep}%
89    \belowdisplayskip \abovedisplayskip
90 }%
91 \renewcommand\LARGE{\@setfontsize\LARGE{41pt}{50pt}}%
92 \renewcommand\huge{\@setfontsize\huge{49pt}{60pt}}%
93 }%
94 }
95
96 %  not supported on texlive version on jessie, and has weird side effects in some readers
97 %% \XeTeXgenerateactualtext=1
98
99 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
100
101 \DeclareOption{defaultleading}{}
102 \DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
103 \DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
104
105 %% 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.
106 \DeclareOption{a5paper}{%
107       \setlength{\paperheight}{210mm}%
108       \setlength{\paperwidth}{148mm}}
109
110
111 \newif\ifshowfootnotes \showfootnotestrue
112 \DeclareOption{nofootnotes}{\showfootnotesfalse}
113
114 \newif\ifendnotes \endnotesfalse
115 \DeclareOption{endnotes}{\endnotestrue}
116
117 \newif\ifshowthemes \showthemestrue
118 \DeclareOption{nothemes}{\showthemesfalse}
119
120 \newif\ifenablewlfont \enablewlfonttrue
121 \DeclareOption{nowlfont}{\enablewlfontfalse}
122
123 \newif\ifshowtoc \showtoctrue
124 \DeclareOption{notoc}{\showtocfalse}
125
126 %\newif\ifsansfont \sansfontfalse
127 %\DeclareOption{sansfont}{\sansfonttrue}
128
129 \newif\ifmargins \marginstrue
130 \DeclareOption{nomargins}{\marginsfalse}
131
132 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
133 \ProcessOptions\relax
134 \LoadClass[a4paper,oneside]{book}
135
136
137 \usepackage{trace}
138
139 \usepackage[MeX]{polski}
140
141 \usepackage[xetex]{graphicx}
142 \usepackage{fontspec}
143 \usepackage{xunicode}
144 \usepackage{xltxtra}
145
146 \usepackage{longtable}
147 \usepackage{tabu}
148 \usepackage{unicode-math}
149 \setmathfont{Latin Modern Math}
150
151 \usepackage{wrapfig}
152
153
154 \ifendnotes
155   \usepackage{enotez}
156   \setenotez{list-name=Przypisy}
157   \setenotez{backref=true}
158 \fi
159
160
161 \usepackage[overload]{textcase}
162 \usepackage{scalefnt}
163 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
164
165 %\ifsansfont
166 %\renewcommand{\familydefault}{\sfdefault}
167 %\fi
168
169 \newfontfamily\alien[
170 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
171 Numbers=OldStyle,
172 Scale=0.85,
173 LetterSpace=-1.0
174 ] {DejaVu Serif}
175
176 \ifenablewlfont
177 \setmainfont [
178 %ExternalLocation,
179 UprightFont = JunicodeWL-Regular,
180 ItalicFont = JunicodeWL-Italic,
181 BoldFont = JunicodeWL-Regular,
182 BoldItalicFont = JunicodeWL-Italic,
183 SmallCapsFont = JunicodeWL-Regular,
184 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
185 Numbers=OldStyle,
186 Scale=1.04,
187 LetterSpace=-1.0
188 ] {JunicodeWL}
189
190 %\setmainfont [
191 %UprightFont = NotoSerif-Regular,
192 %ItalicFont = NotoSerif-Italic,
193 %BoldFont = NotoSerif-Regular,
194 %BoldItalicFont = NotoSerif-Italic,
195 %SmallCapsFont = NotoSerif-Regular,
196 %SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
197 %Scale=1.04,
198 %LetterSpace=-1.0
199 %] {NotoSerif}
200
201 %\setsansfont [
202 %UprightFont = NotoSansDisplay-Regular,
203 %ItalicFont = NotoSansDisplay-Italic,
204 %BoldFont = NotoSansDisplay-Regular,
205 %BoldItalicFont = NotoSansDisplay-Italic,
206 %SmallCapsFont = NotoSansDisplay-Regular,
207 %SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
208 %Scale=1.04,
209 %LetterSpace=-1.0
210 %] {NotoSansDisplay}
211
212 \defaultfontfeatures{
213 SizeFeatures={
214   {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
215   {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
216   {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
217 }
218 }
219
220 \renewcommand{\textsc}[1]{%
221 {\addfontfeature{
222 SizeFeatures={
223   {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
224   {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
225   {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
226 },
227 Letters={SmallCaps,UppercaseSmallCaps}
228 }
229 #1}
230 }
231 \fi% enablewlfont
232
233 %{\Itshape JunicodeWL-Italic.ttf }
234 %{\bfseries Junicode-Bold.ttf }
235 %{\bfseries\itshape Junicode-BoldItalic.ttf }
236
237 \pagestyle{plain}
238 \usepackage{fancyhdr}
239 \usepackage{marginnote}
240
241
242 \makeatletter
243
244 % bottom figure below footnotes
245 \usepackage{fnpos}
246 \makeFNabove
247
248 \usepackage{color}
249 \definecolor{theme}{gray}{.3}
250
251 \ifmargins
252 \setlength{\marginparsep}{2em}
253 \setlength{\marginparwidth}{8.5em}
254 \setlength{\oddsidemargin}{0pt}
255 \setlength{\voffset}{0pt}
256 \setlength{\topmargin}{0pt}
257 \setlength{\headheight}{0pt}
258 \setlength{\headsep}{0pt}
259 \setlength{\textheight}{24cm}
260 \else
261 \addtolength{\oddsidemargin}{-.875in}
262 \addtolength{\evensidemargin}{-.875in}
263 \addtolength{\textwidth}{1.75in}
264
265 \addtolength{\topmargin}{-.875in}
266 \addtolength{\textheight}{1.5in}
267 \fi
268
269 \pagestyle{fancy}
270 \fancyhf{}
271 \renewcommand{\headrulewidth}{0pt}
272 \renewcommand{\footrulewidth}{0pt}
273 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
274 \cfoot{}
275 \rfoot{{\footnotesize \thepage}}
276
277 \clubpenalty=100000
278 \widowpenalty=100000
279
280
281 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
282 \newsavebox{\ximagebox}\newlength{\ximageheight}
283 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
284 \newcommand{\xbox}[1]
285 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
286 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
287 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
288 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
289 \usebox{\ximagebox}%
290 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
291
292 \newcommand{\makecover}[2]{
293         \pdfpagewidth=#1
294         \pdfpageheight=#2
295
296         \thispagestyle{empty}
297         \newlength{\PictHOffset}
298         \newlength{\PictVOffset}
299         \setlength{\PictHOffset}{1in}
300         \addtolength{\PictHOffset}{\hoffset}
301         \addtolength{\PictHOffset}{\oddsidemargin}
302
303         \setlength{\PictVOffset}{1in}
304         \addtolength{\PictVOffset}{\voffset}
305         \addtolength{\PictVOffset}{\topmargin}
306         \addtolength{\PictVOffset}{\headheight}
307         \addtolength{\PictVOffset}{\headsep}
308         \addtolength{\PictVOffset}{\topskip}
309         \addtolength{\PictVOffset}{-\pdfpageheight}
310
311         \noindent\hspace*{-\PictHOffset}%
312         \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
313             \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
314         \clearpage
315
316         \setlength{\pdfpagewidth}{210mm}
317         \setlength{\pdfpageheight}{297mm}
318 }
319
320
321 \renewcommand{\maketitle}{
322     {
323     \thispagestyle{empty}
324     \footnotesize
325     \color{theme}
326
327     \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
328         \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
329     \end{minipage}
330     \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
331
332     \ifflaglessadvertising
333     \else
334         \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
335         \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
336         \vspace{.5em}
337     \fi
338
339     \ifdefined\thanknote
340         \thanknote
341         \vspace{.5em}
342     \fi
343
344     Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
345     przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
346
347     \end{minipage}
348     \noindent \rule{\linewidth}{0.4pt}
349
350     \vspace{.6em}
351     \color{black}
352     }
353 }
354
355 \newcommand{\editorialsection}{
356   \begin{figure}[b!]
357   {
358     \footnotesize
359     \color{theme}
360     \noindent \rule{\linewidth}{0.4pt}
361
362     \ifdefined\sponsors
363         \marginnote{%
364             \centering%
365             \sponsors%
366         }
367     \fi
368
369     \rightsinfo
370     \vspace{.6em}
371
372     Źródło: \href{\bookurl}{\bookurl}
373
374     \vspace{.6em}
375     \sourceinfo
376
377     \publisherinfo
378
379     \description
380     \vspace{.6em}
381
382     \editors
383
384     \ifdefined\funders
385         \vspace{.6em}
386         \funders
387     \fi
388
389     \ifdefined\coverby
390         \vspace{.6em}
391         \coverby
392     \fi
393
394     \ifdefined\isbn
395         \vspace{.6em}
396         \isbn
397     \fi
398
399     \vspace{.6em}
400     \emph{Wesprzyj Wolne Lektury!}
401
402     Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
403     pożytku publicznego działającej na rzecz wolności korzystania
404     z dóbr kultury.
405
406     Co roku do domeny publicznej przechodzi twórczość kolejnych autorów.
407     Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie.
408
409     \vspace{.6em}
410     \emph{Jak możesz pomóc?}
411
412     Przekaż 1\% podatku na rozwój Wolnych Lektur:
413     Fundacja Nowoczesna Polska, KRS 0000070056.
414
415     Dołącz do \href{https://wolnelektury.pl/towarzystwo/}{Towarzystwa Przyjaciół Wolnych Lektur} i pomóż nam rozwijać bibliotekę.
416
417     Przekaż darowiznę na konto:
418     \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
419
420     \color{black}
421   }
422   \end{figure}
423 }
424
425
426 \newcommand{\typosubsubsection}[1]{%
427 \iflargefont
428 {\textsc{\scalefont{2}#1}}
429 \else
430 {\textsc{#1}}
431 \fi
432 }
433
434 \newcommand{\typosubsection}[1]{%
435 {\addfontfeature{
436 SizeFeatures={
437   {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
438   {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
439   {Size={12-}, FakeStretch=2.0, LetterSpace=8.0 }
440 },
441 Letters={Uppercase}
442 }
443 \iflargefont
444 \MakeUppercase{\scalefont{2}#1}
445 \else
446 \MakeUppercase{#1}
447 \fi}
448 }
449
450 \newcommand{\typosection}[1]{%
451 \iflargefont
452 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{4}#1}}
453 \else
454 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
455 \fi
456 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
457 }
458
459
460 \DeclareRobustCommand\authortoctext[1]{%
461 {\addvspace{10pt}\nopagebreak\leftskip0em\relax
462 \rightskip \@tocrmarg\relax
463 \noindent\itshape#1\par}}
464
465 \newcommand\authortoc[1]{%
466   \gdef\chapterauthor{#1}%
467   \addtocontents{toc}{\authortoctext{#1}}}
468
469
470 \newcommand{\tytul}[1]{%
471 #1%
472 \vspace{1em}%
473 }
474
475 \newcommand{\nazwapodutworu}[2]{%
476 \vspace{5ex}%
477 \section*{\typosection{#1}}%
478 \addcontentsline{toc}{section}{#2}%
479 }
480
481 \newcommand{\nazwanadpodutworu}[2]{%
482 \authortoc{}%
483 \nazwapodutworu{#1}{#2}%
484 \authortoc{}%
485 }
486
487 \newcommand{\autorutworu}[1]{%
488 \subsection*{\typosubsection{#1}}%
489 }
490
491 \newcommand{\autorpodutworu}[1]{%
492 \vspace{5ex}%
493 \subsection*{\typosubsection{#1}}%
494 \authortoc{#1}%
495 }
496
497 \newcommand{\dzielonadrzedne}[1]{%
498 \subsection*{\typosubsubsection{#1}}%
499 }
500
501 \newcommand{\nazwautworu}[1]{%
502 \vspace{5ex}%
503 \section*{\typosection{#1}}%
504 }
505
506 \newcommand{\podtytul}[1]{%
507 \subsection*{\typosubsubsection{#1}}%
508 }
509
510 \newcommand{\translator}[1]{%
511 \subsection*{\typosubsubsection{tłum. #1}}%
512 }
513
514
515 \newcommand{\powiesc}[1]{#1}
516 \newcommand{\opowiadanie}[1]{#1}
517 \newcommand{\lirykal}[1]{#1}
518 \newcommand{\lirykalp}[1]{#1}
519 \newcommand{\dramatwierszowanyl}[1]{#1}
520 \newcommand{\dramatwierszowanylp}[1]{#1}
521 \newcommand{\dramatwspolczesny}[1]{#1}
522
523 \newcommand{\nota}[1]{%
524 \par{\raggedleft \emph{#1}}%
525 \vspace{5ex}%
526 }
527
528 \newcommand{\dedykacja}[1]{%
529 \begin{em}%
530 \begin{flushright}%
531 #1%
532 \end{flushright}%
533 \end{em}%
534 }
535
536 \newlength{\fboxhsep}
537 \newlength{\fboxvsep}
538
539 \newlength{\fboxtoprule}
540 \newlength{\fboxbottomrule}
541 \newlength{\fboxleftrule}
542 \newlength{\fboxrightrule}
543
544 \ifshowthemes
545 \setlength{\fboxhsep}{5\fboxsep}
546 \setlength{\fboxvsep}{20\fboxsep}
547 \fi
548
549 \setlength{\fboxtoprule}{\fboxrule}
550 \setlength{\fboxleftrule}{\fboxrule}
551 \setlength{\fboxrightrule}{\fboxrule}
552 \setlength{\fboxbottomrule}{\fboxrule}
553
554
555
556 \def\@frameb@xother#1{%
557   \@tempdima\fboxtoprule
558   \advance\@tempdima\fboxvsep
559   \advance\@tempdima\dp\@tempboxa
560   \hbox{%
561     \lower\@tempdima\hbox{%
562       \vbox{%
563         \hrule\@height\fboxtoprule
564         \hbox{%
565           \vrule\@width\fboxleftrule
566           #1%
567           \vbox{%
568             \vskip\fboxvsep
569             \box\@tempboxa
570             \vskip\fboxvsep}%
571           #1%
572           \vrule\@width\fboxrightrule}%
573         \hrule\@height\fboxbottomrule}%
574     }%
575   }%
576 }
577
578
579 \long\def\fboxother#1{%
580   \leavevmode
581   \setbox\@tempboxa\hbox{%
582     \color@begingroup
583     \kern\fboxhsep{#1}\kern\fboxhsep
584     \color@endgroup}%
585   \@frameb@xother\relax}
586
587 \newcommand{\myfbox}[3]{%
588   \begingroup
589   \setlength{\fboxhsep}{#1}
590   \setlength{\fboxvsep}{#2}
591   \fboxother{#3}
592
593   \endgroup
594 }
595
596 \newcommand{\ramka}[1]{%
597 \par\vspace{1em}%
598 \edef\myindent{\the\parindent}%
599 \noindent\myfbox{1em}{1em}{%
600 \parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{%
601 \setlength{\parindent}{\myindent}%
602 #1%
603 }}%
604 \vspace{1em}%
605 }
606
607 \newcommand{\dlugicytat}[1]{%
608 \begin{quotation}%
609 #1%
610 \end{quotation}%
611 }
612
613 \newcommand{\poezjacyt}[1]{%
614 \begin{verse}%
615 #1%
616 \end{verse}%
617 }
618 \newcommand{\motto}[1]{%
619 \begin{em}%
620 #1%
621 \end{em}%
622 }
623 \newcommand{\listaosob}[2]{%
624 \par{#1}%
625 \begin{itemize}%
626 #2%
627 \end{itemize}%
628 }
629
630 \newcommand{\nagloweklisty}[1]{%
631 \typosubsubsection{#1}%
632 }
633
634 \newcommand{\listaosoba}[1]{%
635 \item[]{#1}%
636 }
637
638 \newcommand{\kwestia}[1]{%
639 \par{#1}%
640 }
641
642 \newcommand{\naglowekakt}[2]{%
643 \pagebreak
644 \subsection*{\typosubsection{\huge #1}}%
645 \addcontentsline{toc}{subsection}{#2}%
646 \vspace{5ex}%
647 }
648
649 \newcommand{\podtytulakt}[1]{%
650 \par{\typosubsubsection{\LARGE #1}}%
651 \vspace{5ex}%
652 }
653
654 \newcommand{\naglowekczesc}[2]{%
655 \pagebreak
656 \subsection*{\typosubsection{\huge #1}}%
657 \addcontentsline{toc}{subsection}{#2}%
658 \vspace{5ex}%
659 }
660
661 \newcommand{\podtytulczesc}[1]{%
662 \par{\typosubsubsection{\LARGE #1}}%
663 \vspace{5ex}%
664 }
665
666 \newcommand{\srodtytul}[1]{%
667 \subsection*{\typosubsection{#1}}%
668 }
669
670 \newcommand{\naglowekscena}[2]{%
671 \subsubsection*{\typosubsubsection{\LARGE #1}}%
672 \addcontentsline{toc}{subsubsection}{#2}%
673 \vspace{5ex}%
674 }
675
676 \newcommand{\podtytulscena}[1]{%
677 \par{\large #1}%
678 \vspace{5ex}%
679 }
680
681 \newcommand{\naglowekrozdzial}[2]{%
682 \subsubsection*{\typosubsubsection{\LARGE #1}}%
683 \addcontentsline{toc}{subsubsection}{#2}%
684 \vspace{5ex}%
685 }
686
687 \newcommand{\podtytulrozdzial}[1]{%
688 \par{\large #1}%
689 \vspace{5ex}%
690 }
691
692 \newcommand{\naglowekosoba}[1]{%
693 \medskip%
694 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
695 }
696 \newcommand{\naglowekpodrozdzial}[1]{%
697 \vspace{5ex}\par{#1}\nopagebreak%
698 }
699
700 \newcommand{\podtytulpodrozdzial}[1]{%
701 \par{#1}\nopagebreak%
702 }
703
704 \newcommand{\miejsceczas}[1]{%
705 \par{\emph{#1}}%
706 }
707 \newcommand{\didaskalia}[1]{%
708 \par{\emph{#1}}%
709 }
710
711 \usepackage{intcalc}
712 \usepackage{color}
713 \definecolor{gray}{RGB}{200,200,200}
714 %\newcounter{parnum}
715 \newlength{\parnumwidth}
716 \setlength{\parnumwidth}{3em}
717 \newcommand{\N}{%
718   \leavevmode\refstepcounter{parnum}\reversemarginpar%
719   \marginnote{\textcolor{gray}{\small{\theparnum}}}%
720   \reversemarginpar}
721 \newcommand{\Nw}{%
722   \leavevmode\refstepcounter{parnum}\reversemarginpar%
723   \ifnum\intcalcMod{\value{parnum}}{5}=0%
724   \marginnote{\textcolor{gray}{\small{\theparnum}}}%
725   \fi\reversemarginpar}
726 \renewcommand{\N}{}
727 \renewcommand{\Nw}{}
728
729 \newcommand{\akap}[1]{%
730 \par{\N#1}%
731 }
732 \newcommand{\akapdialog}[1]{%
733 \par{\N#1}%
734 }
735 \newcommand{\akapcd}[1]{%
736 \par{\N#1}%
737 }
738
739 \newcommand{\mottopodpis}[1]{%
740 \begin{em}%
741 \begin{flushright}%
742 #1%
743 \end{flushright}%
744 \end{em}%
745 }
746
747 \newcommand{\strofa}[1]{%
748 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
749 }
750
751 \newcommand{\wers}[1]{\Nw#1}
752
753 \newcommand{\wersakap}[1]{%
754 \Nw\hspace*{1em}#1%
755 }
756 \newcommand{\werscd}[1]{%
757 \Nw\hspace*{8em}#1%
758 }
759 \newcommand{\werswciety}[2][1em]{%
760 \Nw\hspace*{#1}#2%
761 }
762 \newcommand{\wersdoprawej}[1]{%
763 \Nw\hspace*{\fill}#1%
764 }
765
766 \ifshowfootnotes
767   \ifendnotes
768     \newcommand{\pa}[1]{\NoCaseChange{\endnote{#1 [przypis autorski]}}}
769     \newcommand{\pe}[1]{\NoCaseChange{\endnote{#1 [przypis edytorski]}}}
770     \newcommand{\pr}[1]{\NoCaseChange{\endnote{#1 [przypis redakcyjny]}}}
771     \newcommand{\pt}[1]{\NoCaseChange{\endnote{#1 [przypis tłumacza]}}}
772   \else
773     \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
774     \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1 [przypis edytorski]}}}
775     \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1 [przypis redakcyjny]}}}
776     \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1 [przypis tłumacza]}}}
777   \fi
778 \else
779   \newcommand{\pa}[1]{}
780   \newcommand{\pe}[1]{}
781   \newcommand{\pr}[1]{}
782   \newcommand{\pt}[1]{}
783 \fi
784
785 \newcommand{\mat}[1]{$#1$}
786
787 \newcommand{\didasktekst}[1]{%
788 \emph{#1}%
789 }
790 \newcommand{\slowoobce}[1]{%
791 \emph{#1}%
792 }
793 \newcommand{\tytuldziela}[1]{%
794 \emph{#1}%
795 }
796 \newcommand{\wyroznienie}[1]{%
797 \emph{#1}%
798 }
799 \newcommand{\indeksdolny}[1]{%
800 \textsubscript{#1}%
801 }
802 \newcommand{\wiekszeodstepy}[1]{%
803 \spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax%
804 #1%
805 \spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax%
806 }
807
808 \newcommand{\osoba}[1]{%
809 {\scshape \MakeLowercase{#1}}%
810 }
811
812 \newcommand{\sekcjaswiatlo}{%
813 \vspace{30pt}%
814 }
815
816 \newcommand{\sekcjaasterysk}{%
817 \vspace{10pt}%
818 \begin{center}%
819 \par{*}%
820 \end{center}%
821 }
822
823 \newcommand{\separatorlinia}{%
824 \vspace{10pt}%
825 \hrule{}%
826 \vspace{10pt}%
827 }
828
829 \newcommand{\motyw}[2][0]{%
830 \ifshowthemes
831 \mbox{}%
832 \marginpar{%
833 \vspace{-8pt}%
834 \vspace{-#1\baselineskip}%
835 \raggedright{\hspace{0pt}%
836 \footnotesize{\color{theme}{#2}}}%
837 \vspace{\baselineskip}%
838 }%
839 \fi
840 }
841
842 \newcommand{\ilustr}[2]{%
843 \vspace{1em}%
844 \par{\noindent\includegraphics[width=\linewidth]{#1}}%
845 \vspace{1em}
846 }