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}
148 \usepackage[overload]{textcase}
149 \usepackage{scalefnt}
150 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
153 %\renewcommand{\familydefault}{\sfdefault}
156 \newfontfamily\alien[
157 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
166 UprightFont = JunicodeWL-Regular,
167 ItalicFont = JunicodeWL-Italic,
168 BoldFont = JunicodeWL-Regular,
169 BoldItalicFont = JunicodeWL-Italic,
170 SmallCapsFont = JunicodeWL-Regular,
171 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
178 %UprightFont = NotoSerif-Regular,
179 %ItalicFont = NotoSerif-Italic,
180 %BoldFont = NotoSerif-Regular,
181 %BoldItalicFont = NotoSerif-Italic,
182 %SmallCapsFont = NotoSerif-Regular,
183 %SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
189 %UprightFont = NotoSansDisplay-Regular,
190 %ItalicFont = NotoSansDisplay-Italic,
191 %BoldFont = NotoSansDisplay-Regular,
192 %BoldItalicFont = NotoSansDisplay-Italic,
193 %SmallCapsFont = NotoSansDisplay-Regular,
194 %SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
199 \defaultfontfeatures{
201 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
202 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
203 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
207 \renewcommand{\textsc}[1]{%
210 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
211 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
212 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
214 Letters={SmallCaps,UppercaseSmallCaps}
220 %{\Itshape JunicodeWL-Italic.ttf }
221 %{\bfseries Junicode-Bold.ttf }
222 %{\bfseries\itshape Junicode-BoldItalic.ttf }
225 \usepackage{fancyhdr}
226 \usepackage{marginnote}
231 % bottom figure below footnotes
236 \definecolor{theme}{gray}{.3}
239 \setlength{\marginparsep}{2em}
240 \setlength{\marginparwidth}{8.5em}
241 \setlength{\oddsidemargin}{0pt}
242 \setlength{\voffset}{0pt}
243 \setlength{\topmargin}{0pt}
244 \setlength{\headheight}{0pt}
245 \setlength{\headsep}{0pt}
246 \setlength{\textheight}{24cm}
248 \addtolength{\oddsidemargin}{-.875in}
249 \addtolength{\evensidemargin}{-.875in}
250 \addtolength{\textwidth}{1.75in}
252 \addtolength{\topmargin}{-.875in}
253 \addtolength{\textheight}{1.5in}
258 \renewcommand{\headrulewidth}{0pt}
259 \renewcommand{\footrulewidth}{0pt}
260 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
262 \rfoot{{\footnotesize \thepage}}
268 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
269 \newsavebox{\ximagebox}\newlength{\ximageheight}
270 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
271 \newcommand{\xbox}[1]
272 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
273 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
274 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
275 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
277 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
279 \newcommand{\makecover}[2]{
283 \thispagestyle{empty}
284 \newlength{\PictHOffset}
285 \newlength{\PictVOffset}
286 \setlength{\PictHOffset}{1in}
287 \addtolength{\PictHOffset}{\hoffset}
288 \addtolength{\PictHOffset}{\oddsidemargin}
290 \setlength{\PictVOffset}{1in}
291 \addtolength{\PictVOffset}{\voffset}
292 \addtolength{\PictVOffset}{\topmargin}
293 \addtolength{\PictVOffset}{\headheight}
294 \addtolength{\PictVOffset}{\headsep}
295 \addtolength{\PictVOffset}{\topskip}
296 \addtolength{\PictVOffset}{-\pdfpageheight}
298 \noindent\hspace*{-\PictHOffset}%
299 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
300 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
303 \setlength{\pdfpagewidth}{210mm}
304 \setlength{\pdfpageheight}{297mm}
308 \renewcommand{\maketitle}{
310 \thispagestyle{empty}
314 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
315 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
317 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
319 \ifflaglessadvertising
321 \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
322 \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
331 Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
332 przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
335 \noindent \rule{\linewidth}{0.4pt}
342 \newcommand{\editorialsection}{
347 \noindent \rule{\linewidth}{0.4pt}
359 Źródło: \href{\bookurl}{\bookurl}
387 \emph{Wesprzyj Wolne Lektury!}
389 Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
390 pożytku publicznego działającej na rzecz wolności korzystania
393 Co roku do domeny publicznej przechodzi twórczość kolejnych autorów.
394 Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie.
397 \emph{Jak możesz pomóc?}
399 Przekaż 1\% podatku na rozwój Wolnych Lektur:
400 Fundacja Nowoczesna Polska, KRS 0000070056.
402 Pomóż uwolnić konkretną książkę, wspierając
403 \href{http://www.wolnelektury.pl/wesprzyj/}{zbiórkę na stronie wolnelektury.pl}.
405 Przekaż darowiznę na konto:
406 \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
414 \newcommand{\typosubsubsection}[1]{%
416 {\textsc{\scalefont{2}#1}}
422 \newcommand{\typosubsection}[1]{%
425 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
426 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
427 {Size={12-}, FakeStretch=2.0, LetterSpace=8.0 }
432 \MakeUppercase{\scalefont{2}#1}
438 \newcommand{\typosection}[1]{%
440 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{4}#1}}
442 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
444 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
448 \DeclareRobustCommand\authortoctext[1]{%
449 {\addvspace{10pt}\nopagebreak\leftskip0em\relax
450 \rightskip \@tocrmarg\relax
451 \noindent\itshape#1\par}}
453 \newcommand\authortoc[1]{%
454 \gdef\chapterauthor{#1}%
455 \addtocontents{toc}{\authortoctext{#1}}}
458 \newcommand{\tytul}[1]{%
463 \newcommand{\nazwapodutworu}[2]{%
465 \section*{\typosection{#1}}%
466 \addcontentsline{toc}{section}{#2}%
469 \newcommand{\nazwanadpodutworu}[2]{%
471 \nazwapodutworu{#1}{#2}%
475 \newcommand{\autorutworu}[1]{%
476 \subsection*{\typosubsection{#1}}%
479 \newcommand{\autorpodutworu}[1]{%
481 \subsection*{\typosubsection{#1}}%
485 \newcommand{\dzielonadrzedne}[1]{%
486 \subsection*{\typosubsubsection{#1}}%
489 \newcommand{\nazwautworu}[1]{%
491 \section*{\typosection{#1}}%
494 \newcommand{\podtytul}[1]{%
495 \subsection*{\typosubsubsection{#1}}%
498 \newcommand{\translator}[1]{%
499 \subsection*{\typosubsubsection{tłum. #1}}%
503 \newcommand{\powiesc}[1]{#1}
504 \newcommand{\opowiadanie}[1]{#1}
505 \newcommand{\lirykal}[1]{#1}
506 \newcommand{\lirykalp}[1]{#1}
507 \newcommand{\dramatwierszowanyl}[1]{#1}
508 \newcommand{\dramatwierszowanylp}[1]{#1}
509 \newcommand{\dramatwspolczesny}[1]{#1}
511 \newcommand{\nota}[1]{%
512 \par{\raggedleft \emph{#1}}%
516 \newcommand{\dedykacja}[1]{%
524 \newlength{\fboxhsep}
525 \newlength{\fboxvsep}
527 \newlength{\fboxtoprule}
528 \newlength{\fboxbottomrule}
529 \newlength{\fboxleftrule}
530 \newlength{\fboxrightrule}
533 \setlength{\fboxhsep}{5\fboxsep}
534 \setlength{\fboxvsep}{20\fboxsep}
537 \setlength{\fboxtoprule}{\fboxrule}
538 \setlength{\fboxleftrule}{\fboxrule}
539 \setlength{\fboxrightrule}{\fboxrule}
540 \setlength{\fboxbottomrule}{\fboxrule}
544 \def\@frameb@xother#1{%
545 \@tempdima\fboxtoprule
546 \advance\@tempdima\fboxvsep
547 \advance\@tempdima\dp\@tempboxa
549 \lower\@tempdima\hbox{%
551 \hrule\@height\fboxtoprule
553 \vrule\@width\fboxleftrule
560 \vrule\@width\fboxrightrule}%
561 \hrule\@height\fboxbottomrule}%
567 \long\def\fboxother#1{%
569 \setbox\@tempboxa\hbox{%
571 \kern\fboxhsep{#1}\kern\fboxhsep
573 \@frameb@xother\relax}
575 \newcommand{\myfbox}[3]{%
577 \setlength{\fboxhsep}{#1}
578 \setlength{\fboxvsep}{#2}
584 \newcommand{\ramka}[1]{%
586 \edef\myindent{\the\parindent}%
587 \noindent\myfbox{1em}{1em}{%
588 \parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{%
589 \setlength{\parindent}{\myindent}%
595 \newcommand{\dlugicytat}[1]{%
601 \newcommand{\poezjacyt}[1]{%
606 \newcommand{\motto}[1]{%
611 \newcommand{\listaosob}[2]{%
618 \newcommand{\nagloweklisty}[1]{%
619 \typosubsubsection{#1}%
622 \newcommand{\listaosoba}[1]{%
626 \newcommand{\kwestia}[1]{%
630 \newcommand{\naglowekakt}[2]{%
632 \subsection*{\typosubsection{\huge #1}}%
633 \addcontentsline{toc}{subsection}{#2}%
636 \newcommand{\naglowekczesc}[2]{%
638 \subsection*{\typosubsection{\huge #1}}%
639 \addcontentsline{toc}{subsection}{#2}%
642 \newcommand{\srodtytul}[1]{%
643 \subsection*{\typosubsection{#1}}%
646 \newcommand{\naglowekscena}[2]{%
647 \subsubsection*{\typosubsubsection{\LARGE #1}}%
648 \addcontentsline{toc}{subsubsection}{#2}%
651 \newcommand{\naglowekrozdzial}[2]{%
652 \subsubsection*{\typosubsubsection{\LARGE #1}}%
653 \addcontentsline{toc}{subsubsection}{#2}%
657 \newcommand{\naglowekosoba}[1]{%
659 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
661 \newcommand{\naglowekpodrozdzial}[1]{%
662 \vspace{5ex}\par{#1}\nopagebreak%
665 \newcommand{\miejsceczas}[1]{%
668 \newcommand{\didaskalia}[1]{%
674 \definecolor{gray}{RGB}{200,200,200}
676 \newlength{\parnumwidth}
677 \setlength{\parnumwidth}{3em}
679 \leavevmode\refstepcounter{parnum}\reversemarginpar%
680 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
683 \leavevmode\refstepcounter{parnum}\reversemarginpar%
684 \ifnum\intcalcMod{\value{parnum}}{5}=0%
685 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
686 \fi\reversemarginpar}
690 \newcommand{\akap}[1]{%
693 \newcommand{\akapdialog}[1]{%
696 \newcommand{\akapcd}[1]{%
700 \newcommand{\mottopodpis}[1]{%
708 \newcommand{\strofa}[1]{%
709 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
712 \newcommand{\wers}[1]{\Nw#1}
714 \newcommand{\wersakap}[1]{%
717 \newcommand{\werscd}[1]{%
720 \newcommand{\werswciety}[2][1em]{%
723 \newcommand{\wersdoprawej}[1]{%
724 \Nw\hspace*{\fill}#1%
728 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
729 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1 [przypis edytorski]}}}
730 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1 [przypis redakcyjny]}}}
731 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1 [przypis tłumacza]}}}
733 \newcommand{\pa}[1]{}
734 \newcommand{\pe}[1]{}
735 \newcommand{\pr}[1]{}
736 \newcommand{\pt}[1]{}
739 \newcommand{\mat}[1]{$#1$}
741 \newcommand{\didasktekst}[1]{%
744 \newcommand{\slowoobce}[1]{%
747 \newcommand{\tytuldziela}[1]{%
750 \newcommand{\wyroznienie}[1]{%
753 \newcommand{\indeksdolny}[1]{%
756 \newcommand{\wiekszeodstepy}[1]{%
757 \spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax%
759 \spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax%
762 \newcommand{\osoba}[1]{%
763 {\scshape \MakeLowercase{#1}}%
766 \newcommand{\sekcjaswiatlo}{%
770 \newcommand{\sekcjaasterysk}{%
777 \newcommand{\separatorlinia}{%
783 \newcommand{\motyw}[2][0]{%
788 \vspace{-#1\baselineskip}%
789 \raggedright{\hspace{0pt}%
790 \footnotesize{\color{theme}{#2}}}%
791 \vspace{\baselineskip}%
796 \newcommand{\ilustr}[2]{%
798 \par{\noindent\includegraphics[width=\linewidth]{#1}}%