1 % -*- coding: utf-8 -*-
2 \NeedsTeXFormat{LaTeX2e}
3 \ProvidesClass{wl}[2011/11/28 wolnelektury.pl book style]
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
15 \RequirePackage{fixltx2e}
16 \RequirePackage{setspace}
17 \RequirePackage{type1cm}
18 \DeclareOption{13pt}{%
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@
37 \belowdisplayskip \abovedisplayskip
41 \DeclareOption{16pt}{%
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@
60 \belowdisplayskip \abovedisplayskip
68 \DeclareOption{26pt}{%
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@
89 \belowdisplayskip \abovedisplayskip
91 \renewcommand\LARGE{\@setfontsize\LARGE{41pt}{50pt}}%
92 \renewcommand\huge{\@setfontsize\huge{49pt}{60pt}}%
96 % not supported on texlive version on jessie, and has weird side effects in some readers
97 %% \XeTeXgenerateactualtext=1
99 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
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}}
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}}
111 \newif\ifshowfootnotes \showfootnotestrue
112 \DeclareOption{nofootnotes}{\showfootnotesfalse}
114 \newif\ifendnotes \endnotesfalse
115 \DeclareOption{endnotes}{\endnotestrue}
117 \newif\ifshowthemes \showthemestrue
118 \DeclareOption{nothemes}{\showthemesfalse}
120 \newif\ifenablewlfont \enablewlfonttrue
121 \DeclareOption{nowlfont}{\enablewlfontfalse}
123 \newif\ifshowtoc \showtoctrue
124 \DeclareOption{notoc}{\showtocfalse}
126 %\newif\ifsansfont \sansfontfalse
127 %\DeclareOption{sansfont}{\sansfonttrue}
129 \newif\ifmargins \marginstrue
130 \DeclareOption{nomargins}{\marginsfalse}
132 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
133 \ProcessOptions\relax
134 \LoadClass[a4paper,oneside]{book}
139 \usepackage[MeX]{polski}
141 \usepackage[xetex]{graphicx}
142 \usepackage{fontspec}
143 \usepackage{xunicode}
146 \usepackage{longtable}
148 \usepackage{unicode-math}
149 \setmathfont{Latin Modern Math}
156 \setenotez{list-name=Przypisy}
157 \setenotez{backref=true}
161 \usepackage[overload]{textcase}
162 \usepackage{scalefnt}
163 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
166 %\renewcommand{\familydefault}{\sfdefault}
169 \newfontfamily\alien[
170 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
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}},
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}},
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}},
212 \defaultfontfeatures{
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 }
220 \renewcommand{\textsc}[1]{%
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 }
227 Letters={SmallCaps,UppercaseSmallCaps}
233 %{\Itshape JunicodeWL-Italic.ttf }
234 %{\bfseries Junicode-Bold.ttf }
235 %{\bfseries\itshape Junicode-BoldItalic.ttf }
238 \usepackage{fancyhdr}
239 \usepackage{marginnote}
244 % bottom figure below footnotes
249 \definecolor{theme}{gray}{.3}
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}
261 \addtolength{\oddsidemargin}{-.875in}
262 \addtolength{\evensidemargin}{-.875in}
263 \addtolength{\textwidth}{1.75in}
265 \addtolength{\topmargin}{-.875in}
266 \addtolength{\textheight}{1.5in}
271 \renewcommand{\headrulewidth}{0pt}
272 \renewcommand{\footrulewidth}{0pt}
273 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
275 \rfoot{{\footnotesize \thepage}}
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}}}%}%
290 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
292 \newcommand{\makecover}[2]{
296 \thispagestyle{empty}
297 \newlength{\PictHOffset}
298 \newlength{\PictVOffset}
299 \setlength{\PictHOffset}{1in}
300 \addtolength{\PictHOffset}{\hoffset}
301 \addtolength{\PictHOffset}{\oddsidemargin}
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}
311 \noindent\hspace*{-\PictHOffset}%
312 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
313 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
316 \setlength{\pdfpagewidth}{210mm}
317 \setlength{\pdfpageheight}{297mm}
321 \renewcommand{\maketitle}{
323 \thispagestyle{empty}
327 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
328 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
330 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
332 \ifflaglessadvertising
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}.
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}.
348 \noindent \rule{\linewidth}{0.4pt}
355 \newcommand{\editorialsection}{
360 \noindent \rule{\linewidth}{0.4pt}
372 Źródło: \href{\bookurl}{\bookurl}
400 \emph{Wesprzyj Wolne Lektury!}
402 Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
403 pożytku publicznego działającej na rzecz wolności korzystania
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.
410 \emph{Jak możesz pomóc?}
412 Przekaż 1\% podatku na rozwój Wolnych Lektur:
413 Fundacja Nowoczesna Polska, KRS 0000070056.
415 Dołącz do \href{https://wolnelektury.pl/towarzystwo/}{Towarzystwa Przyjaciół Wolnych Lektur} i pomóż nam rozwijać bibliotekę.
417 Przekaż darowiznę na konto:
418 \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
426 \newcommand{\typosubsubsection}[1]{%
428 {\textsc{\scalefont{2}#1}}
434 \newcommand{\typosubsection}[1]{%
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 }
444 \MakeUppercase{\scalefont{2}#1}
450 \newcommand{\typosection}[1]{%
452 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{4}#1}}
454 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
456 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
460 \DeclareRobustCommand\authortoctext[1]{%
461 {\addvspace{10pt}\nopagebreak\leftskip0em\relax
462 \rightskip \@tocrmarg\relax
463 \noindent\itshape#1\par}}
465 \newcommand\authortoc[1]{%
466 \gdef\chapterauthor{#1}%
467 \addtocontents{toc}{\authortoctext{#1}}}
470 \newcommand{\tytul}[1]{%
475 \newcommand{\nazwapodutworu}[2]{%
477 \section*{\typosection{#1}}%
478 \addcontentsline{toc}{section}{#2}%
481 \newcommand{\nazwanadpodutworu}[2]{%
483 \nazwapodutworu{#1}{#2}%
487 \newcommand{\autorutworu}[1]{%
488 \subsection*{\typosubsection{#1}}%
491 \newcommand{\autorpodutworu}[1]{%
493 \subsection*{\typosubsection{#1}}%
497 \newcommand{\dzielonadrzedne}[1]{%
498 \subsection*{\typosubsubsection{#1}}%
501 \newcommand{\nazwautworu}[1]{%
503 \section*{\typosection{#1}}%
506 \newcommand{\podtytul}[1]{%
507 \subsection*{\typosubsubsection{#1}}%
510 \newcommand{\translator}[1]{%
511 \subsection*{\typosubsubsection{tłum. #1}}%
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}
523 \newcommand{\nota}[1]{%
524 \par{\raggedleft \emph{#1}}%
528 \newcommand{\dedykacja}[1]{%
536 \newlength{\fboxhsep}
537 \newlength{\fboxvsep}
539 \newlength{\fboxtoprule}
540 \newlength{\fboxbottomrule}
541 \newlength{\fboxleftrule}
542 \newlength{\fboxrightrule}
545 \setlength{\fboxhsep}{5\fboxsep}
546 \setlength{\fboxvsep}{20\fboxsep}
549 \setlength{\fboxtoprule}{\fboxrule}
550 \setlength{\fboxleftrule}{\fboxrule}
551 \setlength{\fboxrightrule}{\fboxrule}
552 \setlength{\fboxbottomrule}{\fboxrule}
556 \def\@frameb@xother#1{%
557 \@tempdima\fboxtoprule
558 \advance\@tempdima\fboxvsep
559 \advance\@tempdima\dp\@tempboxa
561 \lower\@tempdima\hbox{%
563 \hrule\@height\fboxtoprule
565 \vrule\@width\fboxleftrule
572 \vrule\@width\fboxrightrule}%
573 \hrule\@height\fboxbottomrule}%
579 \long\def\fboxother#1{%
581 \setbox\@tempboxa\hbox{%
583 \kern\fboxhsep{#1}\kern\fboxhsep
585 \@frameb@xother\relax}
587 \newcommand{\myfbox}[3]{%
589 \setlength{\fboxhsep}{#1}
590 \setlength{\fboxvsep}{#2}
596 \newcommand{\ramka}[1]{%
598 \edef\myindent{\the\parindent}%
599 \noindent\myfbox{1em}{1em}{%
600 \parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{%
601 \setlength{\parindent}{\myindent}%
607 \newcommand{\dlugicytat}[1]{%
613 \newcommand{\poezjacyt}[1]{%
618 \newcommand{\motto}[1]{%
623 \newcommand{\listaosob}[2]{%
630 \newcommand{\nagloweklisty}[1]{%
631 \typosubsubsection{#1}%
634 \newcommand{\listaosoba}[1]{%
638 \newcommand{\kwestia}[1]{%
642 \newcommand{\naglowekakt}[2]{%
644 \subsection*{\typosubsection{\huge #1}}%
645 \addcontentsline{toc}{subsection}{#2}%
649 \newcommand{\podtytulakt}[1]{%
650 \par{\typosubsubsection{\LARGE #1}}%
654 \newcommand{\naglowekczesc}[2]{%
656 \subsection*{\typosubsection{\huge #1}}%
657 \addcontentsline{toc}{subsection}{#2}%
661 \newcommand{\podtytulczesc}[1]{%
662 \par{\typosubsubsection{\LARGE #1}}%
666 \newcommand{\srodtytul}[1]{%
667 \subsection*{\typosubsection{#1}}%
670 \newcommand{\naglowekscena}[2]{%
671 \subsubsection*{\typosubsubsection{\LARGE #1}}%
672 \addcontentsline{toc}{subsubsection}{#2}%
676 \newcommand{\podtytulscena}[1]{%
681 \newcommand{\naglowekrozdzial}[2]{%
682 \subsubsection*{\typosubsubsection{\LARGE #1}}%
683 \addcontentsline{toc}{subsubsection}{#2}%
687 \newcommand{\podtytulrozdzial}[1]{%
692 \newcommand{\naglowekosoba}[1]{%
694 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
696 \newcommand{\naglowekpodrozdzial}[1]{%
697 \vspace{5ex}\par{#1}\nopagebreak%
700 \newcommand{\podtytulpodrozdzial}[1]{%
701 \par{#1}\nopagebreak%
704 \newcommand{\miejsceczas}[1]{%
707 \newcommand{\didaskalia}[1]{%
713 \definecolor{gray}{RGB}{200,200,200}
715 \newlength{\parnumwidth}
716 \setlength{\parnumwidth}{3em}
718 \leavevmode\refstepcounter{parnum}\reversemarginpar%
719 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
722 \leavevmode\refstepcounter{parnum}\reversemarginpar%
723 \ifnum\intcalcMod{\value{parnum}}{5}=0%
724 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
725 \fi\reversemarginpar}
729 \newcommand{\akap}[1]{%
732 \newcommand{\akapdialog}[1]{%
735 \newcommand{\akapcd}[1]{%
739 \newcommand{\mottopodpis}[1]{%
747 \newcommand{\strofa}[1]{%
748 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
751 \newcommand{\wers}[1]{\Nw#1}
753 \newcommand{\wersakap}[1]{%
756 \newcommand{\werscd}[1]{%
759 \newcommand{\werswciety}[2][1em]{%
762 \newcommand{\wersdoprawej}[1]{%
763 \Nw\hspace*{\fill}#1%
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]}}}
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]}}}
779 \newcommand{\pa}[1]{}
780 \newcommand{\pe}[1]{}
781 \newcommand{\pr}[1]{}
782 \newcommand{\pt}[1]{}
785 \newcommand{\mat}[1]{$#1$}
787 \newcommand{\didasktekst}[1]{%
790 \newcommand{\slowoobce}[1]{%
793 \newcommand{\tytuldziela}[1]{%
796 \newcommand{\wyroznienie}[1]{%
799 \newcommand{\indeksdolny}[1]{%
802 \newcommand{\wiekszeodstepy}[1]{%
803 \spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax%
805 \spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax%
808 \newcommand{\osoba}[1]{%
809 {\scshape \MakeLowercase{#1}}%
812 \newcommand{\sekcjaswiatlo}{%
816 \newcommand{\sekcjaasterysk}{%
823 \newcommand{\separatorlinia}{%
829 \newcommand{\motyw}[2][0]{%
834 \vspace{-#1\baselineskip}%
835 \raggedright{\hspace{0pt}%
836 \footnotesize{\color{theme}{#2}}}%
837 \vspace{\baselineskip}%
842 \newcommand{\ilustr}[2]{%
844 \par{\noindent\includegraphics[width=\linewidth]{#1}}%