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{\nazwanadpodutworu}[2]{%
361 \nazwapodutworu{#1}{#2}%
365 \newcommand{\autorutworu}[1]{%
366 \subsection*{\typosubsection{#1}}%
369 \newcommand{\autorpodutworu}[1]{%
371 \subsection*{\typosubsection{#1}}%
375 \newcommand{\dzielonadrzedne}[1]{%
376 \subsection*{\typosubsubsection{#1}}%
379 \newcommand{\nazwautworu}[1]{%
381 \section*{\typosection{#1}}%
384 \newcommand{\podtytul}[1]{%
385 \subsection*{\typosubsubsection{#1}}%
388 \newcommand{\translator}[1]{%
389 \subsection*{\typosubsubsection{tłum. #1}}%
393 \newcommand{\powiesc}[1]{#1}
394 \newcommand{\opowiadanie}[1]{#1}
395 \newcommand{\lirykal}[1]{#1}
396 \newcommand{\lirykalp}[1]{#1}
397 \newcommand{\dramatwierszowanyl}[1]{#1}
398 \newcommand{\dramatwierszowanylp}[1]{#1}
399 \newcommand{\dramatwspolczesny}[1]{#1}
401 \newcommand{\nota}[1]{%
402 \par{\raggedleft \emph{#1}}%
406 \newcommand{\dedykacja}[1]{%
414 \newlength{\fboxhsep}
415 \newlength{\fboxvsep}
417 \newlength{\fboxtoprule}
418 \newlength{\fboxbottomrule}
419 \newlength{\fboxleftrule}
420 \newlength{\fboxrightrule}
422 \setlength{\fboxhsep}{5\fboxsep}
423 \setlength{\fboxvsep}{20\fboxsep}
425 \setlength{\fboxtoprule}{\fboxrule}
426 \setlength{\fboxleftrule}{\fboxrule}
427 \setlength{\fboxrightrule}{\fboxrule}
428 \setlength{\fboxbottomrule}{\fboxrule}
432 \def\@frameb@xother#1{%
433 \@tempdima\fboxtoprule
434 \advance\@tempdima\fboxvsep
435 \advance\@tempdima\dp\@tempboxa
437 \lower\@tempdima\hbox{%
439 \hrule\@height\fboxtoprule
441 \vrule\@width\fboxleftrule
448 \vrule\@width\fboxrightrule}%
449 \hrule\@height\fboxbottomrule}%
455 \long\def\fboxother#1{%
457 \setbox\@tempboxa\hbox{%
459 \kern\fboxhsep{#1}\kern\fboxhsep
461 \@frameb@xother\relax}
463 \newcommand{\myfbox}[3]{%
465 \setlength{\fboxhsep}{#1}
466 \setlength{\fboxvsep}{#2}
472 \newcommand{\ramka}[1]{%
474 \edef\myindent{\the\parindent}%
475 \noindent\myfbox{1em}{1em}{%
476 \parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{%
477 \setlength{\parindent}{\myindent}%
483 \newcommand{\dlugicytat}[1]{%
489 \newcommand{\poezjacyt}[1]{%
494 \newcommand{\motto}[1]{%
499 \newcommand{\listaosob}[2]{%
506 \newcommand{\nagloweklisty}[1]{%
507 \typosubsubsection{#1}%
510 \newcommand{\listaosoba}[1]{%
514 \newcommand{\kwestia}[1]{%
518 \newcommand{\naglowekakt}[2]{%
520 \subsection*{\typosubsection{\huge #1}}%
521 \addcontentsline{toc}{subsection}{#2}%
524 \newcommand{\naglowekczesc}[2]{%
526 \subsection*{\typosubsection{\huge #1}}%
527 \addcontentsline{toc}{subsection}{#2}%
530 \newcommand{\srodtytul}[1]{%
531 \subsection*{\typosubsection{#1}}%
534 \newcommand{\naglowekscena}[2]{%
535 \subsubsection*{\typosubsubsection{\LARGE #1}}%
536 \addcontentsline{toc}{subsubsection}{#2}%
539 \newcommand{\naglowekrozdzial}[2]{%
540 \subsubsection*{\typosubsubsection{\LARGE #1}}%
541 \addcontentsline{toc}{subsubsection}{#2}%
545 \newcommand{\naglowekosoba}[1]{%
547 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
549 \newcommand{\naglowekpodrozdzial}[1]{%
550 \vspace{5ex}\par{#1}\nopagebreak%
553 \newcommand{\miejsceczas}[1]{%
556 \newcommand{\didaskalia}[1]{%
562 \definecolor{gray}{RGB}{200,200,200}
564 \newlength{\parnumwidth}
565 \setlength{\parnumwidth}{3em}
567 \leavevmode\refstepcounter{parnum}\reversemarginpar%
568 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
571 \leavevmode\refstepcounter{parnum}\reversemarginpar%
572 \ifnum\intcalcMod{\value{parnum}}{5}=0%
573 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
574 \fi\reversemarginpar}
578 \newcommand{\akap}[1]{%
581 \newcommand{\akapdialog}[1]{%
584 \newcommand{\akapcd}[1]{%
588 \newcommand{\mottopodpis}[1]{%
596 \newcommand{\strofa}[1]{%
597 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
600 \newcommand{\wers}[1]{\Nw#1}
602 \newcommand{\wersakap}[1]{%
605 \newcommand{\werscd}[1]{%
608 \newcommand{\werswciety}[2][1em]{%
611 \newcommand{\wersdoprawej}[1]{%
612 \Nw\hspace*{\fill}#1%
616 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
617 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1 [przypis edytorski]}}}
618 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1 [przypis redakcyjny]}}}
619 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1 [przypis tłumacza]}}}
621 \newcommand{\pa}[1]{}
622 \newcommand{\pe}[1]{}
623 \newcommand{\pr}[1]{}
624 \newcommand{\pt}[1]{}
627 \newcommand{\mat}[1]{$#1$}
629 \newcommand{\didasktekst}[1]{%
632 \newcommand{\slowoobce}[1]{%
635 \newcommand{\tytuldziela}[1]{%
638 \newcommand{\wyroznienie}[1]{%
641 \newcommand{\indeksdolny}[1]{%
644 \newcommand{\wiekszeodstepy}[1]{%
645 \spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax%
647 \spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax%
650 \newcommand{\osoba}[1]{%
651 {\scshape \MakeLowercase{#1}}%
654 \newcommand{\sekcjaswiatlo}{%
658 \newcommand{\sekcjaasterysk}{%
665 \newcommand{\separatorlinia}{%
671 \newcommand{\motyw}[2][0]{%
676 \vspace{-#1\baselineskip}%
677 \raggedright{\hspace{0pt}%
678 \footnotesize{\color{theme}{#2}}}%
679 \vspace{\baselineskip}%
684 \newcommand{\ilustr}[2]{%
686 \par{\noindent\includegraphics[width=\linewidth]{#1}}%