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
42 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
44 \DeclareOption{defaultleading}{}
45 \DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
46 \DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
48 %% 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.
49 \DeclareOption{a5paper}{%
50 \setlength{\paperheight}{210mm}%
51 \setlength{\paperwidth}{148mm}}
54 \newif\ifshowfootnotes \showfootnotestrue
55 \DeclareOption{nofootnotes}{\showfootnotesfalse}
57 \newif\ifshowthemes \showthemestrue
58 \DeclareOption{nothemes}{\showthemesfalse}
60 \newif\ifenablewlfont \enablewlfonttrue
61 \DeclareOption{nowlfont}{\enablewlfontfalse}
63 \newif\ifshowtoc \showtoctrue
64 \DeclareOption{notoc}{\showtocfalse}
66 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
68 \LoadClass[a4paper,oneside]{book}
73 \usepackage[MeX]{polski}
75 \usepackage[xetex]{graphicx}
80 \usepackage{longtable}
82 \usepackage{unicode-math}
83 \setmathfont{Latin Modern Math}
85 \usepackage[overload]{textcase}
87 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
90 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
99 UprightFont = JunicodeWL-Regular,
100 ItalicFont = JunicodeWL-Italic,
101 BoldFont = JunicodeWL-Regular,
102 BoldItalicFont = JunicodeWL-Italic,
103 SmallCapsFont = JunicodeWL-Regular,
104 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
110 \defaultfontfeatures{
112 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
113 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
114 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
118 \renewcommand{\textsc}[1]{%
121 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
122 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
123 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
125 Letters={SmallCaps,UppercaseSmallCaps}
131 %{\Itshape JunicodeWL-Italic.ttf }
132 %{\bfseries Junicode-Bold.ttf }
133 %{\bfseries\itshape Junicode-BoldItalic.ttf }
136 \usepackage{fancyhdr}
137 \usepackage{marginnote}
142 % bottom figure below footnotes
147 \definecolor{theme}{gray}{.3}
149 \setlength{\marginparsep}{2em}
150 \setlength{\marginparwidth}{8.5em}
151 \setlength{\oddsidemargin}{0pt}
152 \setlength{\voffset}{0pt}
153 \setlength{\topmargin}{0pt}
154 \setlength{\headheight}{0pt}
155 \setlength{\headsep}{0pt}
156 \setlength{\textheight}{24cm}
160 \renewcommand{\headrulewidth}{0pt}
161 \renewcommand{\footrulewidth}{0pt}
162 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
164 \rfoot{{\footnotesize \thepage}}
170 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
171 \newsavebox{\ximagebox}\newlength{\ximageheight}
172 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
173 \newcommand{\xbox}[1]
174 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
175 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
176 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
177 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
179 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
181 \newcommand{\makecover}[2]{
185 \thispagestyle{empty}
186 \newlength{\PictHOffset}
187 \newlength{\PictVOffset}
188 \setlength{\PictHOffset}{1in}
189 \addtolength{\PictHOffset}{\hoffset}
190 \addtolength{\PictHOffset}{\oddsidemargin}
192 \setlength{\PictVOffset}{1in}
193 \addtolength{\PictVOffset}{\voffset}
194 \addtolength{\PictVOffset}{\topmargin}
195 \addtolength{\PictVOffset}{\headheight}
196 \addtolength{\PictVOffset}{\headsep}
197 \addtolength{\PictVOffset}{\topskip}
198 \addtolength{\PictVOffset}{-\pdfpageheight}
200 \noindent\hspace*{-\PictHOffset}%
201 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
202 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
205 \setlength{\pdfpagewidth}{210mm}
206 \setlength{\pdfpageheight}{297mm}
210 \renewcommand{\maketitle}{
212 \thispagestyle{empty}
216 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
217 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
219 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
221 \ifflaglessadvertising
223 \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
224 \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
233 Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
234 przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
237 \noindent \rule{\linewidth}{0.4pt}
244 \newcommand{\editorialsection}{
249 \noindent \rule{\linewidth}{0.4pt}
261 Źródło: \href{\bookurl}{\bookurl}
289 \emph{Wesprzyj Wolne Lektury!}
291 Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
292 pożytku publicznego działającej na rzecz wolności korzystania
295 Co roku do domeny publicznej przechodzi twórczość kolejnych autorów.
296 Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie.
299 \emph{Jak możesz pomóc?}
301 Przekaż 1\% podatku na rozwój Wolnych Lektur:
302 Fundacja Nowoczesna Polska, KRS 0000070056.
304 Pomóż uwolnić konkretną książkę, wspierając
305 \href{http://www.wolnelektury.pl/wesprzyj/}{zbiórkę na stronie wolnelektury.pl}.
307 Przekaż darowiznę na konto:
308 \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
316 \newcommand{\typosubsubsection}[1]{%
320 \newcommand{\typosubsection}[1]{%
323 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
324 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
325 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
332 \newcommand{\typosection}[1]{%
333 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
334 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
338 \DeclareRobustCommand\authortoctext[1]{%
339 {\addvspace{10pt}\nopagebreak\leftskip0em\relax
340 \rightskip \@tocrmarg\relax
341 \noindent\itshape#1\par}}
343 \newcommand\authortoc[1]{%
344 \gdef\chapterauthor{#1}%
345 \addtocontents{toc}{\authortoctext{#1}}}
348 \newcommand{\tytul}[1]{%
353 \newcommand{\nazwapodutworu}[2]{%
355 \section*{\typosection{#1}}%
356 \addcontentsline{toc}{section}{#2}%
359 \newcommand{\autorutworu}[1]{%
360 \subsection*{\typosubsection{#1}}%
363 \newcommand{\autorpodutworu}[1]{%
365 \subsection*{\typosubsection{#1}}%
369 \newcommand{\dzielonadrzedne}[1]{%
370 \subsection*{\typosubsubsection{#1}}%
373 \newcommand{\nazwautworu}[1]{%
375 \section*{\typosection{#1}}%
378 \newcommand{\podtytul}[1]{%
379 \subsection*{\typosubsubsection{#1}}%
382 \newcommand{\translator}[1]{%
383 \subsection*{\typosubsubsection{tłum. #1}}%
387 \newcommand{\powiesc}[1]{#1}
388 \newcommand{\opowiadanie}[1]{#1}
389 \newcommand{\lirykal}[1]{#1}
390 \newcommand{\lirykalp}[1]{#1}
391 \newcommand{\dramatwierszowanyl}[1]{#1}
392 \newcommand{\dramatwierszowanylp}[1]{#1}
393 \newcommand{\dramatwspolczesny}[1]{#1}
395 \newcommand{\nota}[1]{%
396 \par{\raggedleft \emph{#1}}%
400 \newcommand{\dedykacja}[1]{%
408 \newlength{\fboxhsep}
409 \newlength{\fboxvsep}
411 \newlength{\fboxtoprule}
412 \newlength{\fboxbottomrule}
413 \newlength{\fboxleftrule}
414 \newlength{\fboxrightrule}
416 \setlength{\fboxhsep}{5\fboxsep}
417 \setlength{\fboxvsep}{20\fboxsep}
419 \setlength{\fboxtoprule}{\fboxrule}
420 \setlength{\fboxleftrule}{\fboxrule}
421 \setlength{\fboxrightrule}{\fboxrule}
422 \setlength{\fboxbottomrule}{\fboxrule}
426 \def\@frameb@xother#1{%
427 \@tempdima\fboxtoprule
428 \advance\@tempdima\fboxvsep
429 \advance\@tempdima\dp\@tempboxa
431 \lower\@tempdima\hbox{%
433 \hrule\@height\fboxtoprule
435 \vrule\@width\fboxleftrule
442 \vrule\@width\fboxrightrule}%
443 \hrule\@height\fboxbottomrule}%
449 \long\def\fboxother#1{%
451 \setbox\@tempboxa\hbox{%
453 \kern\fboxhsep{#1}\kern\fboxhsep
455 \@frameb@xother\relax}
457 \newcommand{\myfbox}[3]{%
459 \setlength{\fboxhsep}{#1}
460 \setlength{\fboxvsep}{#2}
466 \newcommand{\ramka}[1]{%
468 \edef\myindent{\the\parindent}%
469 \noindent\myfbox{1em}{1em}{%
470 \parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{%
471 \setlength{\parindent}{\myindent}%
477 \newcommand{\dlugicytat}[1]{%
483 \newcommand{\poezjacyt}[1]{%
488 \newcommand{\motto}[1]{%
493 \newcommand{\listaosob}[2]{%
500 \newcommand{\nagloweklisty}[1]{%
501 \typosubsubsection{#1}%
504 \newcommand{\listaosoba}[1]{%
508 \newcommand{\kwestia}[1]{%
512 \newcommand{\naglowekakt}[2]{%
514 \subsection*{\typosubsection{\huge #1}}%
515 \addcontentsline{toc}{subsection}{#2}%
518 \newcommand{\naglowekczesc}[2]{%
520 \subsection*{\typosubsection{\huge #1}}%
521 \addcontentsline{toc}{subsection}{#2}%
524 \newcommand{\srodtytul}[1]{%
525 \subsection*{\typosubsection{#1}}%
528 \newcommand{\naglowekscena}[2]{%
529 \subsubsection*{\typosubsubsection{\LARGE #1}}%
530 \addcontentsline{toc}{subsubsection}{#2}%
533 \newcommand{\naglowekrozdzial}[2]{%
534 \subsubsection*{\typosubsubsection{\LARGE #1}}%
535 \addcontentsline{toc}{subsubsection}{#2}%
539 \newcommand{\naglowekosoba}[1]{%
541 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
543 \newcommand{\naglowekpodrozdzial}[1]{%
544 \vspace{5ex}\par{#1}\nopagebreak%
547 \newcommand{\miejsceczas}[1]{%
550 \newcommand{\didaskalia}[1]{%
556 \definecolor{gray}{RGB}{200,200,200}
558 \newlength{\parnumwidth}
559 \setlength{\parnumwidth}{3em}
561 \leavevmode\refstepcounter{parnum}\reversemarginpar%
562 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
565 \leavevmode\refstepcounter{parnum}\reversemarginpar%
566 \ifnum\intcalcMod{\value{parnum}}{5}=0%
567 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
568 \fi\reversemarginpar}
572 \newcommand{\akap}[1]{%
575 \newcommand{\akapdialog}[1]{%
578 \newcommand{\akapcd}[1]{%
582 \newcommand{\mottopodpis}[1]{%
590 \newcommand{\strofa}[1]{%
591 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
594 \newcommand{\wers}[1]{\Nw#1}
596 \newcommand{\wersakap}[1]{%
599 \newcommand{\werscd}[1]{%
602 \newcommand{\werswciety}[2][1em]{%
605 \newcommand{\wersdoprawej}[1]{%
606 \Nw\hspace*{\fill}#1%
610 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
611 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1 [przypis edytorski]}}}
612 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1 [przypis redakcyjny]}}}
613 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1 [przypis tłumacza]}}}
615 \newcommand{\pa}[1]{}
616 \newcommand{\pe}[1]{}
617 \newcommand{\pr}[1]{}
618 \newcommand{\pt}[1]{}
621 \newcommand{\mat}[1]{$#1$}
623 \newcommand{\didasktekst}[1]{%
626 \newcommand{\slowoobce}[1]{%
629 \newcommand{\tytuldziela}[1]{%
632 \newcommand{\wyroznienie}[1]{%
635 \newcommand{\indeksdolny}[1]{%
638 \newcommand{\wiekszeodstepy}[1]{%
639 \spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax%
641 \spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax%
644 \newcommand{\osoba}[1]{%
645 {\scshape \MakeLowercase{#1}}%
648 \newcommand{\sekcjaswiatlo}{%
652 \newcommand{\sekcjaasterysk}{%
659 \newcommand{\separatorlinia}{%
665 \newcommand{\motyw}[2][0]{%
670 \vspace{-#1\baselineskip}%
671 \raggedright{\hspace{0pt}%
672 \footnotesize{\color{theme}{#2}}}%
673 \vspace{\baselineskip}%
678 \newcommand{\ilustr}[2]{%
680 \par{\noindent\includegraphics[width=\linewidth]{#1}}%