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 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
65 \LoadClass[a4paper,oneside]{book}
70 \usepackage[MeX]{polski}
72 \usepackage[xetex]{graphicx}
77 \usepackage{longtable}
79 \usepackage{unicode-math}
80 \setmathfont{Latin Modern Math}
82 \usepackage[overload]{textcase}
84 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
87 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
96 UprightFont = JunicodeWL-Regular,
97 ItalicFont = JunicodeWL-Italic,
98 BoldFont = JunicodeWL-Regular,
99 BoldItalicFont = JunicodeWL-Italic,
100 SmallCapsFont = JunicodeWL-Regular,
101 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
107 \defaultfontfeatures{
109 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
110 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
111 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
115 \renewcommand{\textsc}[1]{%
118 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
119 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
120 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
122 Letters={SmallCaps,UppercaseSmallCaps}
128 %{\Itshape JunicodeWL-Italic.ttf }
129 %{\bfseries Junicode-Bold.ttf }
130 %{\bfseries\itshape Junicode-BoldItalic.ttf }
133 \usepackage{fancyhdr}
134 \usepackage{marginnote}
139 % bottom figure below footnotes
144 \definecolor{theme}{gray}{.3}
146 \setlength{\marginparsep}{2em}
147 \setlength{\marginparwidth}{8.5em}
148 \setlength{\oddsidemargin}{0pt}
149 \setlength{\voffset}{0pt}
150 \setlength{\topmargin}{0pt}
151 \setlength{\headheight}{0pt}
152 \setlength{\headsep}{0pt}
153 \setlength{\textheight}{24cm}
157 \renewcommand{\headrulewidth}{0pt}
158 \renewcommand{\footrulewidth}{0pt}
159 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
161 \rfoot{{\footnotesize \thepage}}
167 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
168 \newsavebox{\ximagebox}\newlength{\ximageheight}
169 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
170 \newcommand{\xbox}[1]
171 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
172 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
173 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
174 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
176 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
178 \newcommand{\makecover}[2]{
182 \thispagestyle{empty}
183 \newlength{\PictHOffset}
184 \newlength{\PictVOffset}
185 \setlength{\PictHOffset}{1in}
186 \addtolength{\PictHOffset}{\hoffset}
187 \addtolength{\PictHOffset}{\oddsidemargin}
189 \setlength{\PictVOffset}{1in}
190 \addtolength{\PictVOffset}{\voffset}
191 \addtolength{\PictVOffset}{\topmargin}
192 \addtolength{\PictVOffset}{\headheight}
193 \addtolength{\PictVOffset}{\headsep}
194 \addtolength{\PictVOffset}{\topskip}
195 \addtolength{\PictVOffset}{-\pdfpageheight}
197 \noindent\hspace*{-\PictHOffset}%
198 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
199 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
202 \setlength{\pdfpagewidth}{210mm}
203 \setlength{\pdfpageheight}{297mm}
207 \renewcommand{\maketitle}{
209 \thispagestyle{empty}
213 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
214 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
216 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
218 \ifflaglessadvertising
220 \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
221 \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
230 Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
231 przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
234 \noindent \rule{\linewidth}{0.4pt}
241 \newcommand{\editorialsection}{
246 \noindent \rule{\linewidth}{0.4pt}
258 Źródło: \href{\bookurl}{\bookurl}
286 \emph{Wesprzyj Wolne Lektury!}
288 Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
289 pożytku publicznego działającej na rzecz wolności korzystania
292 Co roku do domeny publicznej przechodzi twórczość kolejnych autorów.
293 Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie.
296 \emph{Jak możesz pomóc?}
298 Przekaż 1\% podatku na rozwój Wolnych Lektur:
299 Fundacja Nowoczesna Polska, KRS 0000070056.
301 Pomóż uwolnić konkretną książkę, wspierając
302 \href{http://www.wolnelektury.pl/wesprzyj/}{zbiórkę na stronie wolnelektury.pl}.
304 Przekaż darowiznę na konto:
305 \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
313 \newcommand{\typosubsubsection}[1]{%
317 \newcommand{\typosubsection}[1]{%
320 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
321 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
322 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
329 \newcommand{\typosection}[1]{%
330 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
331 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
335 \newcommand{\tytul}[1]{%
340 \newcommand{\nazwapodutworu}[1]{%
341 \section*{\typosection{#1}}%
344 \newcommand{\autorutworu}[1]{%
345 \subsection*{\typosubsection{#1}}%
348 \newcommand{\dzielonadrzedne}[1]{%
349 \subsection*{\typosubsubsection{#1}}%
352 \newcommand{\nazwautworu}[1]{%
353 \section*{\typosection{#1}}%
356 \newcommand{\podtytul}[1]{%
357 \subsection*{\typosubsubsection{#1}}%
360 \newcommand{\translator}[1]{%
361 \subsection*{\typosubsubsection{tłum. #1}}%
365 \newcommand{\powiesc}[1]{#1}
366 \newcommand{\opowiadanie}[1]{#1}
367 \newcommand{\lirykal}[1]{#1}
368 \newcommand{\lirykalp}[1]{#1}
369 \newcommand{\dramatwierszowanyl}[1]{#1}
370 \newcommand{\dramatwierszowanylp}[1]{#1}
371 \newcommand{\dramatwspolczesny}[1]{#1}
373 \newcommand{\nota}[1]{%
377 \newcommand{\dedykacja}[1]{%
385 \newlength{\fboxhsep}
386 \newlength{\fboxvsep}
388 \newlength{\fboxtoprule}
389 \newlength{\fboxbottomrule}
390 \newlength{\fboxleftrule}
391 \newlength{\fboxrightrule}
393 \setlength{\fboxhsep}{5\fboxsep}
394 \setlength{\fboxvsep}{20\fboxsep}
396 \setlength{\fboxtoprule}{\fboxrule}
397 \setlength{\fboxleftrule}{\fboxrule}
398 \setlength{\fboxrightrule}{\fboxrule}
399 \setlength{\fboxbottomrule}{\fboxrule}
403 \def\@frameb@xother#1{%
404 \@tempdima\fboxtoprule
405 \advance\@tempdima\fboxvsep
406 \advance\@tempdima\dp\@tempboxa
408 \lower\@tempdima\hbox{%
410 \hrule\@height\fboxtoprule
412 \vrule\@width\fboxleftrule
419 \vrule\@width\fboxrightrule}%
420 \hrule\@height\fboxbottomrule}%
426 \long\def\fboxother#1{%
428 \setbox\@tempboxa\hbox{%
430 \kern\fboxhsep{#1}\kern\fboxhsep
432 \@frameb@xother\relax}
434 \newcommand{\myfbox}[3]{%
436 \setlength{\fboxhsep}{#1}
437 \setlength{\fboxvsep}{#2}
443 \newcommand{\ramka}[1]{%
445 \edef\myindent{\the\parindent}%
446 \noindent\myfbox{1em}{1em}{%
447 \parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{%
448 \setlength{\parindent}{\myindent}%
454 \newcommand{\dlugicytat}[1]{%
460 \newcommand{\poezjacyt}[1]{%
465 \newcommand{\motto}[1]{%
470 \newcommand{\listaosob}[2]{%
477 \newcommand{\nagloweklisty}[1]{%
478 \typosubsubsection{#1}%
481 \newcommand{\listaosoba}[1]{%
485 \newcommand{\kwestia}[1]{%
489 \newcommand{\naglowekakt}[1]{%
491 \subsection*{\typosubsection{#1}}%
493 \newcommand{\naglowekczesc}[1]{%
495 \subsection*{\typosubsection{#1}}%
497 \newcommand{\srodtytul}[1]{%
498 \subsection*{\typosubsection{#1}}%
501 \newcommand{\naglowekscena}[1]{%
502 \subsubsection*{\typosubsubsection{#1}}%
504 \newcommand{\naglowekrozdzial}[1]{%
505 \subsubsection*{\typosubsubsection{#1}}%
508 \newcommand{\naglowekosoba}[1]{%
509 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
511 \newcommand{\naglowekpodrozdzial}[1]{%
512 \vspace{5ex}\par{#1}\nopagebreak%
515 \newcommand{\miejsceczas}[1]{%
518 \newcommand{\didaskalia}[1]{%
524 \definecolor{gray}{RGB}{200,200,200}
526 \newlength{\parnumwidth}
527 \setlength{\parnumwidth}{3em}
529 \leavevmode\refstepcounter{parnum}\reversemarginpar%
530 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
533 \leavevmode\refstepcounter{parnum}\reversemarginpar%
534 \ifnum\intcalcMod{\value{parnum}}{5}=0%
535 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
536 \fi\reversemarginpar}
540 \newcommand{\akap}[1]{%
543 \newcommand{\akapdialog}[1]{%
546 \newcommand{\akapcd}[1]{%
550 \newcommand{\mottopodpis}[1]{%
558 \newcommand{\strofa}[1]{%
559 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
562 \newcommand{\wers}[1]{\Nw#1}
564 \newcommand{\wersakap}[1]{%
567 \newcommand{\werscd}[1]{%
570 \newcommand{\werswciety}[2][1em]{%
573 \newcommand{\wersdoprawej}[1]{%
574 \Nw\hspace*{\fill}#1%
578 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
579 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1 [przypis edytorski]}}}
580 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1 [przypis redakcyjny]}}}
581 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1 [przypis tłumacza]}}}
583 \newcommand{\pa}[1]{}
584 \newcommand{\pe}[1]{}
585 \newcommand{\pr}[1]{}
586 \newcommand{\pt}[1]{}
589 \newcommand{\mat}[1]{$#1$}
591 \newcommand{\didasktekst}[1]{%
594 \newcommand{\slowoobce}[1]{%
597 \newcommand{\tytuldziela}[1]{%
600 \newcommand{\wyroznienie}[1]{%
603 \newcommand{\indeksdolny}[1]{%
606 \newcommand{\wiekszeodstepy}[1]{%
607 \spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax%
609 \spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax%
612 \newcommand{\osoba}[1]{%
616 \newcommand{\sekcjaswiatlo}{%
620 \newcommand{\sekcjaasterysk}{%
627 \newcommand{\separatorlinia}{%
633 \newcommand{\motyw}[2][0]{%
638 \vspace{-#1\baselineskip}%
639 \raggedright{\hspace{0pt}%
640 \footnotesize{\color{theme}{#2}}}%
641 \vspace{\baselineskip}%
646 \newcommand{\ilustr}[2]{%
648 \par{\noindent\includegraphics[width=\linewidth]{#1}}%