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\ifshowthemes \showthemestrue
115 \DeclareOption{nothemes}{\showthemesfalse}
117 \newif\ifenablewlfont \enablewlfonttrue
118 \DeclareOption{nowlfont}{\enablewlfontfalse}
120 \newif\ifshowtoc \showtoctrue
121 \DeclareOption{notoc}{\showtocfalse}
123 %\newif\ifsansfont \sansfontfalse
124 %\DeclareOption{sansfont}{\sansfonttrue}
126 \newif\ifmargins \marginstrue
127 \DeclareOption{nomargins}{\marginsfalse}
129 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
130 \ProcessOptions\relax
131 \LoadClass[a4paper,oneside]{book}
136 \usepackage[MeX]{polski}
138 \usepackage[xetex]{graphicx}
139 \usepackage{fontspec}
140 \usepackage{xunicode}
143 \usepackage{longtable}
145 \usepackage{unicode-math}
146 \setmathfont{Latin Modern Math}
150 \usepackage[overload]{textcase}
151 \usepackage{scalefnt}
152 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
155 %\renewcommand{\familydefault}{\sfdefault}
158 \newfontfamily\alien[
159 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
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}},
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}},
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}},
201 \defaultfontfeatures{
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 }
209 \renewcommand{\textsc}[1]{%
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 }
216 Letters={SmallCaps,UppercaseSmallCaps}
222 %{\Itshape JunicodeWL-Italic.ttf }
223 %{\bfseries Junicode-Bold.ttf }
224 %{\bfseries\itshape Junicode-BoldItalic.ttf }
227 \usepackage{fancyhdr}
228 \usepackage{marginnote}
233 % bottom figure below footnotes
238 \definecolor{theme}{gray}{.3}
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}
250 \addtolength{\oddsidemargin}{-.875in}
251 \addtolength{\evensidemargin}{-.875in}
252 \addtolength{\textwidth}{1.75in}
254 \addtolength{\topmargin}{-.875in}
255 \addtolength{\textheight}{1.5in}
260 \renewcommand{\headrulewidth}{0pt}
261 \renewcommand{\footrulewidth}{0pt}
262 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
264 \rfoot{{\footnotesize \thepage}}
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}}}%}%
279 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
281 \newcommand{\makecover}[2]{
285 \thispagestyle{empty}
286 \newlength{\PictHOffset}
287 \newlength{\PictVOffset}
288 \setlength{\PictHOffset}{1in}
289 \addtolength{\PictHOffset}{\hoffset}
290 \addtolength{\PictHOffset}{\oddsidemargin}
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}
300 \noindent\hspace*{-\PictHOffset}%
301 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
302 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
305 \setlength{\pdfpagewidth}{210mm}
306 \setlength{\pdfpageheight}{297mm}
310 \renewcommand{\maketitle}{
312 \thispagestyle{empty}
316 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
317 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
319 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
321 \ifflaglessadvertising
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}.
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}.
337 \noindent \rule{\linewidth}{0.4pt}
344 \newcommand{\editorialsection}{
349 \noindent \rule{\linewidth}{0.4pt}
361 Źródło: \href{\bookurl}{\bookurl}
389 \emph{Wesprzyj Wolne Lektury!}
391 Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
392 pożytku publicznego działającej na rzecz wolności korzystania
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.
399 \emph{Jak możesz pomóc?}
401 Przekaż 1\% podatku na rozwój Wolnych Lektur:
402 Fundacja Nowoczesna Polska, KRS 0000070056.
404 Dołącz do \href{https://wolnelektury.pl/towarzystwo/}{Towarzystwa Przyjaciół Wolnych Lektur} i pomóż nam rozwijać bibliotekę.
406 Przekaż darowiznę na konto:
407 \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
415 \newcommand{\typosubsubsection}[1]{%
417 {\textsc{\scalefont{2}#1}}
423 \newcommand{\typosubsection}[1]{%
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 }
433 \MakeUppercase{\scalefont{2}#1}
439 \newcommand{\typosection}[1]{%
441 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{4}#1}}
443 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
445 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
449 \DeclareRobustCommand\authortoctext[1]{%
450 {\addvspace{10pt}\nopagebreak\leftskip0em\relax
451 \rightskip \@tocrmarg\relax
452 \noindent\itshape#1\par}}
454 \newcommand\authortoc[1]{%
455 \gdef\chapterauthor{#1}%
456 \addtocontents{toc}{\authortoctext{#1}}}
459 \newcommand{\tytul}[1]{%
464 \newcommand{\nazwapodutworu}[2]{%
466 \section*{\typosection{#1}}%
467 \addcontentsline{toc}{section}{#2}%
470 \newcommand{\nazwanadpodutworu}[2]{%
472 \nazwapodutworu{#1}{#2}%
476 \newcommand{\autorutworu}[1]{%
477 \subsection*{\typosubsection{#1}}%
480 \newcommand{\autorpodutworu}[1]{%
482 \subsection*{\typosubsection{#1}}%
486 \newcommand{\dzielonadrzedne}[1]{%
487 \subsection*{\typosubsubsection{#1}}%
490 \newcommand{\nazwautworu}[1]{%
492 \section*{\typosection{#1}}%
495 \newcommand{\podtytul}[1]{%
496 \subsection*{\typosubsubsection{#1}}%
499 \newcommand{\translator}[1]{%
500 \subsection*{\typosubsubsection{tłum. #1}}%
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}
512 \newcommand{\nota}[1]{%
513 \par{\raggedleft \emph{#1}}%
517 \newcommand{\dedykacja}[1]{%
525 \newlength{\fboxhsep}
526 \newlength{\fboxvsep}
528 \newlength{\fboxtoprule}
529 \newlength{\fboxbottomrule}
530 \newlength{\fboxleftrule}
531 \newlength{\fboxrightrule}
534 \setlength{\fboxhsep}{5\fboxsep}
535 \setlength{\fboxvsep}{20\fboxsep}
538 \setlength{\fboxtoprule}{\fboxrule}
539 \setlength{\fboxleftrule}{\fboxrule}
540 \setlength{\fboxrightrule}{\fboxrule}
541 \setlength{\fboxbottomrule}{\fboxrule}
545 \def\@frameb@xother#1{%
546 \@tempdima\fboxtoprule
547 \advance\@tempdima\fboxvsep
548 \advance\@tempdima\dp\@tempboxa
550 \lower\@tempdima\hbox{%
552 \hrule\@height\fboxtoprule
554 \vrule\@width\fboxleftrule
561 \vrule\@width\fboxrightrule}%
562 \hrule\@height\fboxbottomrule}%
568 \long\def\fboxother#1{%
570 \setbox\@tempboxa\hbox{%
572 \kern\fboxhsep{#1}\kern\fboxhsep
574 \@frameb@xother\relax}
576 \newcommand{\myfbox}[3]{%
578 \setlength{\fboxhsep}{#1}
579 \setlength{\fboxvsep}{#2}
585 \newcommand{\ramka}[1]{%
587 \edef\myindent{\the\parindent}%
588 \noindent\myfbox{1em}{1em}{%
589 \parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{%
590 \setlength{\parindent}{\myindent}%
596 \newcommand{\dlugicytat}[1]{%
602 \newcommand{\poezjacyt}[1]{%
607 \newcommand{\motto}[1]{%
612 \newcommand{\listaosob}[2]{%
619 \newcommand{\nagloweklisty}[1]{%
620 \typosubsubsection{#1}%
623 \newcommand{\listaosoba}[1]{%
627 \newcommand{\kwestia}[1]{%
631 \newcommand{\naglowekakt}[2]{%
633 \subsection*{\typosubsection{\huge #1}}%
634 \addcontentsline{toc}{subsection}{#2}%
638 \newcommand{\podtytulakt}[1]{%
639 \par{\typosubsubsection{\LARGE #1}}%
643 \newcommand{\naglowekczesc}[2]{%
645 \subsection*{\typosubsection{\huge #1}}%
646 \addcontentsline{toc}{subsection}{#2}%
650 \newcommand{\podtytulczesc}[1]{%
651 \par{\typosubsubsection{\LARGE #1}}%
655 \newcommand{\srodtytul}[1]{%
656 \subsection*{\typosubsection{#1}}%
659 \newcommand{\naglowekscena}[2]{%
660 \subsubsection*{\typosubsubsection{\LARGE #1}}%
661 \addcontentsline{toc}{subsubsection}{#2}%
665 \newcommand{\podtytulscena}[1]{%
670 \newcommand{\naglowekrozdzial}[2]{%
671 \subsubsection*{\typosubsubsection{\LARGE #1}}%
672 \addcontentsline{toc}{subsubsection}{#2}%
676 \newcommand{\podtytulrozdzial}[1]{%
681 \newcommand{\naglowekosoba}[1]{%
683 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
685 \newcommand{\naglowekpodrozdzial}[1]{%
686 \vspace{5ex}\par{#1}\nopagebreak%
689 \newcommand{\podtytulpodrozdzial}[1]{%
690 \par{#1}\nopagebreak%
693 \newcommand{\miejsceczas}[1]{%
696 \newcommand{\didaskalia}[1]{%
702 \definecolor{gray}{RGB}{200,200,200}
704 \newlength{\parnumwidth}
705 \setlength{\parnumwidth}{3em}
707 \leavevmode\refstepcounter{parnum}\reversemarginpar%
708 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
711 \leavevmode\refstepcounter{parnum}\reversemarginpar%
712 \ifnum\intcalcMod{\value{parnum}}{5}=0%
713 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
714 \fi\reversemarginpar}
718 \newcommand{\akap}[1]{%
721 \newcommand{\akapdialog}[1]{%
724 \newcommand{\akapcd}[1]{%
728 \newcommand{\mottopodpis}[1]{%
736 \newcommand{\strofa}[1]{%
737 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
740 \newcommand{\wers}[1]{\Nw#1}
742 \newcommand{\wersakap}[1]{%
745 \newcommand{\werscd}[1]{%
748 \newcommand{\werswciety}[2][1em]{%
751 \newcommand{\wersdoprawej}[1]{%
752 \Nw\hspace*{\fill}#1%
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]}}}
761 \newcommand{\pa}[1]{}
762 \newcommand{\pe}[1]{}
763 \newcommand{\pr}[1]{}
764 \newcommand{\pt}[1]{}
767 \newcommand{\mat}[1]{$#1$}
769 \newcommand{\didasktekst}[1]{%
772 \newcommand{\slowoobce}[1]{%
775 \newcommand{\tytuldziela}[1]{%
778 \newcommand{\wyroznienie}[1]{%
781 \newcommand{\indeksdolny}[1]{%
784 \newcommand{\wiekszeodstepy}[1]{%
785 \spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax%
787 \spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax%
790 \newcommand{\osoba}[1]{%
791 {\scshape \MakeLowercase{#1}}%
794 \newcommand{\sekcjaswiatlo}{%
798 \newcommand{\sekcjaasterysk}{%
805 \newcommand{\separatorlinia}{%
811 \newcommand{\motyw}[2][0]{%
816 \vspace{-#1\baselineskip}%
817 \raggedright{\hspace{0pt}%
818 \footnotesize{\color{theme}{#2}}}%
819 \vspace{\baselineskip}%
824 \newcommand{\ilustr}[2]{%
826 \par{\noindent\includegraphics[width=\linewidth]{#1}}%