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{setspace}
16 \RequirePackage{type1cm}
17 \DeclareOption{13pt}{%
19 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
20 \renewcommand\normalsize{%
21 \@setfontsize\normalsize{13pt}{14.5pt}%
22 \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
23 \abovedisplayshortskip \z@ \@plus3\p@
24 \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
25 \belowdisplayskip \abovedisplayskip
26 \let\@listi\@listI}\normalsize%
27 \renewcommand\footnotesize{%
28 \@setfontsize\footnotesize\@xpt\@xiipt
29 \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
30 \abovedisplayshortskip \z@ \@plus3\p@
31 \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
32 \def\@listi{\leftmargin\leftmargini
33 \topsep 6\p@ \@plus2\p@ \@minus2\p@
34 \parsep 3\p@ \@plus2\p@ \@minus\p@
36 \belowdisplayskip \abovedisplayskip
41 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
43 \DeclareOption{defaultleading}{}
44 \DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
45 \DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
47 %% 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.
48 \DeclareOption{a5paper}{%
49 \setlength{\paperheight}{210mm}%
50 \setlength{\paperwidth}{148mm}}
53 \newif\ifshowfootnotes \showfootnotestrue
54 \DeclareOption{nofootnotes}{\showfootnotesfalse}
56 \newif\ifshowthemes \showthemestrue
57 \DeclareOption{nothemes}{\showthemesfalse}
59 \newif\ifenablewlfont \enablewlfonttrue
60 \DeclareOption{nowlfont}{\enablewlfontfalse}
62 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
64 \LoadClass[a4paper,oneside]{book}
69 \usepackage[MeX]{polski}
71 \usepackage[xetex]{graphicx}
76 \usepackage{longtable}
78 \usepackage{unicode-math}
79 \setmathfont{Latin Modern Math}
81 \usepackage[overload]{textcase}
83 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
86 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
95 UprightFont = JunicodeWL-Regular,
96 ItalicFont = JunicodeWL-Italic,
97 BoldFont = JunicodeWL-Regular,
98 BoldItalicFont = JunicodeWL-Italic,
99 SmallCapsFont = JunicodeWL-Regular,
100 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
106 \defaultfontfeatures{
108 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
109 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
110 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
114 \renewcommand{\textsc}[1]{%
117 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
118 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
119 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
121 Letters={SmallCaps,UppercaseSmallCaps}
127 %{\Itshape JunicodeWL-Italic.ttf }
128 %{\bfseries Junicode-Bold.ttf }
129 %{\bfseries\itshape Junicode-BoldItalic.ttf }
132 \usepackage{fancyhdr}
133 \usepackage{marginnote}
138 % bottom figure below footnotes
143 \definecolor{theme}{gray}{.3}
145 \setlength{\marginparsep}{2em}
146 \setlength{\marginparwidth}{8.5em}
147 \setlength{\oddsidemargin}{0pt}
148 \setlength{\voffset}{0pt}
149 \setlength{\topmargin}{0pt}
150 \setlength{\headheight}{0pt}
151 \setlength{\headsep}{0pt}
152 \setlength{\textheight}{24cm}
156 \renewcommand{\headrulewidth}{0pt}
157 \renewcommand{\footrulewidth}{0pt}
158 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
160 \rfoot{{\footnotesize \thepage}}
166 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
167 \newsavebox{\ximagebox}\newlength{\ximageheight}
168 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
169 \newcommand{\xbox}[1]
170 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
171 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
172 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
173 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
175 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
177 \newcommand{\makecover}[2]{
181 \thispagestyle{empty}
182 \newlength{\PictHOffset}
183 \newlength{\PictVOffset}
184 \setlength{\PictHOffset}{1in}
185 \addtolength{\PictHOffset}{\hoffset}
186 \addtolength{\PictHOffset}{\oddsidemargin}
188 \setlength{\PictVOffset}{1in}
189 \addtolength{\PictVOffset}{\voffset}
190 \addtolength{\PictVOffset}{\topmargin}
191 \addtolength{\PictVOffset}{\headheight}
192 \addtolength{\PictVOffset}{\headsep}
193 \addtolength{\PictVOffset}{\topskip}
194 \addtolength{\PictVOffset}{-\pdfpageheight}
196 \noindent\hspace*{-\PictHOffset}%
197 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
198 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
201 \setlength{\pdfpagewidth}{210mm}
202 \setlength{\pdfpageheight}{297mm}
206 \renewcommand{\maketitle}{
208 \thispagestyle{empty}
212 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
213 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
215 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
217 \ifflaglessadvertising
219 \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
220 \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
229 Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
230 przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
233 \noindent \rule{\linewidth}{0.4pt}
240 \newcommand{\editorialsection}{
245 \noindent \rule{\linewidth}{0.4pt}
257 Źródło: \href{\bookurl}{\bookurl}
280 \emph{Wesprzyj Wolne Lektury!}
282 Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
283 pożytku publicznego działającej na rzecz wolności korzystania
286 Co roku do domeny publicznej przechodzi twórczość kolejnych autorów.
287 Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie.
290 \emph{Jak możesz pomóc?}
292 Przekaż 1\% podatku na rozwój Wolnych Lektur:
293 Fundacja Nowoczesna Polska, KRS 0000070056.
295 Pomóż uwolnić konkretną książkę, wspierając
296 \href{http://www.wolnelektury.pl/wesprzyj/}{zbiórkę na stronie wolnelektury.pl}.
298 Przekaż darowiznę na konto:
299 \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
307 \newcommand{\typosubsubsection}[1]{%
311 \newcommand{\typosubsection}[1]{%
314 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
315 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
316 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
323 \newcommand{\typosection}[1]{%
324 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
325 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
329 \newcommand{\tytul}[1]{%
334 \newcommand{\nazwapodutworu}[1]{%
335 \section*{\typosection{#1}}%
338 \newcommand{\autorutworu}[1]{%
339 \subsection*{\typosubsection{#1}}%
342 \newcommand{\dzielonadrzedne}[1]{%
343 \subsection*{\typosubsubsection{#1}}%
346 \newcommand{\nazwautworu}[1]{%
347 \section*{\typosection{#1}}%
350 \newcommand{\podtytul}[1]{%
351 \subsection*{\typosubsubsection{#1}}%
354 \newcommand{\translator}[1]{%
355 \subsection*{\typosubsubsection{tłum. #1}}%
359 \newcommand{\powiesc}[1]{#1}
360 \newcommand{\opowiadanie}[1]{#1}
361 \newcommand{\lirykal}[1]{#1}
362 \newcommand{\lirykalp}[1]{#1}
363 \newcommand{\dramatwierszowanyl}[1]{#1}
364 \newcommand{\dramatwierszowanylp}[1]{#1}
365 \newcommand{\dramatwspolczesny}[1]{#1}
367 \newcommand{\nota}[1]{%
371 \newcommand{\dedykacja}[1]{%
379 \newcommand{\dlugicytat}[1]{%
385 \newcommand{\poezjacyt}[1]{%
390 \newcommand{\motto}[1]{%
395 \newcommand{\listaosob}[2]{%
402 \newcommand{\nagloweklisty}[1]{%
403 \typosubsubsection{#1}%
406 \newcommand{\listaosoba}[1]{%
410 \newcommand{\kwestia}[1]{%
414 \newcommand{\naglowekakt}[1]{%
416 \subsection*{\typosubsection{#1}}%
418 \newcommand{\naglowekczesc}[1]{%
420 \subsection*{\typosubsection{#1}}%
422 \newcommand{\srodtytul}[1]{%
423 \subsection*{\typosubsection{#1}}%
426 \newcommand{\naglowekscena}[1]{%
427 \subsubsection*{\typosubsubsection{#1}}%
429 \newcommand{\naglowekrozdzial}[1]{%
430 \subsubsection*{\typosubsubsection{#1}}%
433 \newcommand{\naglowekosoba}[1]{%
434 \par{\textsc{#1}}\nopagebreak%
436 \newcommand{\naglowekpodrozdzial}[1]{%
437 \vspace{5ex}\par{#1}\nopagebreak%
440 \newcommand{\miejsceczas}[1]{%
443 \newcommand{\didaskalia}[1]{%
449 \definecolor{gray}{RGB}{200,200,200}
451 \newlength{\parnumwidth}
452 \setlength{\parnumwidth}{3em}
454 \leavevmode\refstepcounter{parnum}\reversemarginpar%
455 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
458 \leavevmode\refstepcounter{parnum}\reversemarginpar%
459 \ifnum\intcalcMod{\value{parnum}}{5}=0%
460 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
461 \fi\reversemarginpar}
465 \newcommand{\akap}[1]{%
468 \newcommand{\akapdialog}[1]{%
471 \newcommand{\akapcd}[1]{%
475 \newcommand{\mottopodpis}[1]{%
483 \newcommand{\strofa}[1]{%
484 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
487 \newcommand{\wers}[1]{\Nw#1}
489 \newcommand{\wersakap}[1]{%
492 \newcommand{\werscd}[1]{%
495 \newcommand{\werswciety}[2][1em]{%
500 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
501 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1 [przypis edytorski]}}}
502 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1 [przypis redakcyjny]}}}
503 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1 [przypis tłumacza]}}}
505 \newcommand{\pa}[1]{}
506 \newcommand{\pe}[1]{}
507 \newcommand{\pr}[1]{}
508 \newcommand{\pt}[1]{}
511 \newcommand{\mat}[1]{$#1$}
513 \newcommand{\didasktekst}[1]{%
516 \newcommand{\slowoobce}[1]{%
519 \newcommand{\tytuldziela}[1]{%
522 \newcommand{\wyroznienie}[1]{%
526 \newcommand{\osoba}[1]{%
530 \newcommand{\sekcjaswiatlo}{%
534 \newcommand{\sekcjaasterysk}{%
541 \newcommand{\separatorlinia}{%
547 \newcommand{\motyw}[2][0]{%
552 \vspace{-#1\baselineskip}%
553 \raggedright{\hspace{0pt}%
554 \footnotesize{\color{theme}{#2}}}%
555 \vspace{\baselineskip}%
560 \newcommand{\ilustr}[2]{%
562 \par{\noindent\includegraphics[width=\linewidth]{#1}}%