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