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}
88 UprightFont = JunicodeWL-Regular,
89 ItalicFont = JunicodeWL-Italic,
90 BoldFont = JunicodeWL-Regular,
91 BoldItalicFont = JunicodeWL-Italic,
92 SmallCapsFont = JunicodeWL-Regular,
93 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
100 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}
279 \emph{Wesprzyj Wolne Lektury!}
281 Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
282 pożytku publicznego działającej na rzecz wolności korzystania
285 Co roku do domeny publicznej przechodzi twórczość kolejnych autorów.
286 Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie.
289 \emph{Jak możesz pomóc?}
291 Przekaż 1\% podatku na rozwój Wolnych Lektur:
292 Fundacja Nowoczesna Polska, KRS 0000070056.
294 Pomóż uwolnić konkretną książkę, wspierając
295 \href{http://www.wolnelektury.pl/wesprzyj/}{zbiórkę na stronie wolnelektury.pl}.
297 Przekaż darowiznę na konto:
298 \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
306 \newcommand{\typosubsubsection}[1]{%
310 \newcommand{\typosubsection}[1]{%
313 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
314 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
315 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
322 \newcommand{\typosection}[1]{%
323 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
324 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
328 \newcommand{\tytul}[1]{%
333 \newcommand{\nazwapodutworu}[1]{%
334 \section*{\typosection{#1}}%
337 \newcommand{\autorutworu}[1]{%
338 \subsection*{\typosubsection{#1}}%
341 \newcommand{\dzielonadrzedne}[1]{%
342 \subsection*{\typosubsubsection{#1}}%
345 \newcommand{\nazwautworu}[1]{%
346 \section*{\typosection{#1}}%
349 \newcommand{\podtytul}[1]{%
350 \subsection*{\typosubsubsection{#1}}%
353 \newcommand{\translator}[1]{%
354 \subsection*{\typosubsubsection{tłum. #1}}%
358 \newcommand{\powiesc}[1]{#1}
359 \newcommand{\opowiadanie}[1]{#1}
360 \newcommand{\lirykal}[1]{#1}
361 \newcommand{\lirykalp}[1]{#1}
362 \newcommand{\dramatwierszowanyl}[1]{#1}
363 \newcommand{\dramatwierszowanylp}[1]{#1}
364 \newcommand{\dramatwspolczesny}[1]{#1}
366 \newcommand{\nota}[1]{%
370 \newcommand{\dedykacja}[1]{%
378 \newcommand{\dlugicytat}[1]{%
384 \newcommand{\poezjacyt}[1]{%
389 \newcommand{\motto}[1]{%
394 \newcommand{\listaosob}[2]{%
401 \newcommand{\nagloweklisty}[1]{%
402 \typosubsubsection{#1}%
405 \newcommand{\listaosoba}[1]{%
409 \newcommand{\kwestia}[1]{%
413 \newcommand{\naglowekakt}[1]{%
415 \subsection*{\typosubsection{#1}}%
417 \newcommand{\naglowekczesc}[1]{%
419 \subsection*{\typosubsection{#1}}%
421 \newcommand{\srodtytul}[1]{%
422 \subsection*{\typosubsection{#1}}%
425 \newcommand{\naglowekscena}[1]{%
426 \subsubsection*{\typosubsubsection{#1}}%
428 \newcommand{\naglowekrozdzial}[1]{%
429 \subsubsection*{\typosubsubsection{#1}}%
432 \newcommand{\naglowekosoba}[1]{%
433 \par{\textsc{#1}}\nopagebreak%
435 \newcommand{\naglowekpodrozdzial}[1]{%
436 \par{#1}\nopagebreak%
439 \newcommand{\miejsceczas}[1]{%
442 \newcommand{\didaskalia}[1]{%
446 \newcommand{\akap}[1]{%
449 \newcommand{\akapdialog}[1]{%
452 \newcommand{\akapcd}[1]{%
456 \newcommand{\mottopodpis}[1]{%
464 \newcommand{\strofa}[1]{%
465 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
468 \newcommand{\wers}[1]{#1}
470 \newcommand{\wersakap}[1]{%
473 \newcommand{\werscd}[1]{%
476 \newcommand{\werswciety}[2][1em]{%
481 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
482 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
483 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
484 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
486 \newcommand{\pa}[1]{}
487 \newcommand{\pe}[1]{}
488 \newcommand{\pr}[1]{}
489 \newcommand{\pt}[1]{}
492 \newcommand{\mat}[1]{$#1$}
494 \newcommand{\didasktekst}[1]{%
497 \newcommand{\slowoobce}[1]{%
500 \newcommand{\tytuldziela}[1]{%
503 \newcommand{\wyroznienie}[1]{%
507 \newcommand{\osoba}[1]{%
511 \newcommand{\sekcjaswiatlo}{%
515 \newcommand{\sekcjaasterysk}{%
522 \newcommand{\separatorlinia}{%
528 \newcommand{\motyw}[2][0]{%
533 \vspace{-#1\baselineskip}%
534 \raggedright{\hspace{0pt}%
535 \footnotesize{\color{theme}{#2}}}%
536 \vspace{\baselineskip}%
541 \newcommand{\ilustr}[2]{%
543 \par{\noindent\includegraphics[width=\linewidth]{#1}}%