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[overload]{textcase}
78 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
83 UprightFont = JunicodeWL-Regular,
84 ItalicFont = JunicodeWL-Italic,
85 BoldFont = JunicodeWL-Regular,
86 BoldItalicFont = JunicodeWL-Italic,
87 SmallCapsFont = JunicodeWL-Regular,
88 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
95 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
102 \defaultfontfeatures{
104 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
105 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
106 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
110 \renewcommand{\textsc}[1]{%
113 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
114 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
115 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
117 Letters={SmallCaps,UppercaseSmallCaps}
123 %{\Itshape JunicodeWL-Italic.ttf }
124 %{\bfseries Junicode-Bold.ttf }
125 %{\bfseries\itshape Junicode-BoldItalic.ttf }
128 \usepackage{fancyhdr}
129 \usepackage{marginnote}
134 % bottom figure below footnotes
139 \definecolor{theme}{gray}{.3}
141 \setlength{\marginparsep}{2em}
142 \setlength{\marginparwidth}{8.5em}
143 \setlength{\oddsidemargin}{0pt}
144 \setlength{\voffset}{0pt}
145 \setlength{\topmargin}{0pt}
146 \setlength{\headheight}{0pt}
147 \setlength{\headsep}{0pt}
148 \setlength{\textheight}{24cm}
152 \renewcommand{\headrulewidth}{0pt}
153 \renewcommand{\footrulewidth}{0pt}
154 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
156 \rfoot{{\footnotesize \thepage}}
162 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
163 \newsavebox{\ximagebox}\newlength{\ximageheight}
164 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
165 \newcommand{\xbox}[1]
166 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
167 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
168 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
169 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
171 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
173 \newcommand{\makecover}[2]{
177 \thispagestyle{empty}
178 \newlength{\PictHOffset}
179 \newlength{\PictVOffset}
180 \setlength{\PictHOffset}{1in}
181 \addtolength{\PictHOffset}{\hoffset}
182 \addtolength{\PictHOffset}{\oddsidemargin}
184 \setlength{\PictVOffset}{1in}
185 \addtolength{\PictVOffset}{\voffset}
186 \addtolength{\PictVOffset}{\topmargin}
187 \addtolength{\PictVOffset}{\headheight}
188 \addtolength{\PictVOffset}{\headsep}
189 \addtolength{\PictVOffset}{\topskip}
190 \addtolength{\PictVOffset}{-\pdfpageheight}
192 \noindent\hspace*{-\PictHOffset}%
193 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
194 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
197 \setlength{\pdfpagewidth}{210mm}
198 \setlength{\pdfpageheight}{297mm}
202 \renewcommand{\maketitle}{
204 \thispagestyle{empty}
208 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
209 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
211 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
213 \ifflaglessadvertising
215 \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
216 \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
225 Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
226 przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
229 \noindent \rule{\linewidth}{0.4pt}
236 \newcommand{\editorialsection}{
241 \noindent \rule{\linewidth}{0.4pt}
253 Źródło: \href{\bookurl}{\bookurl}
274 \emph{Wesprzyj Wolne Lektury!}
276 Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
277 pożytku publicznego działającej na rzecz wolności korzystania
280 Co roku do domeny publicznej przechodzi twórczość kolejnych autorów.
281 Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie.
284 \emph{Jak możesz pomóc?}
286 Przekaż 1\% podatku na rozwój Wolnych Lektur:
287 Fundacja Nowoczesna Polska, KRS 0000070056.
289 Pomóż uwolnić konkretną książkę, wspierając
290 \href{http://www.wolnelektury.pl/wesprzyj/}{zbiórkę na stronie wolnelektury.pl}.
292 Przekaż darowiznę na konto:
293 \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
301 \newcommand{\typosubsubsection}[1]{%
305 \newcommand{\typosubsection}[1]{%
308 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
309 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
310 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
317 \newcommand{\typosection}[1]{%
318 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
319 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
323 \newcommand{\tytul}[1]{%
328 \newcommand{\nazwapodutworu}[1]{%
329 \section*{\typosection{#1}}%
332 \newcommand{\autorutworu}[1]{%
333 \subsection*{\typosubsection{#1}}%
336 \newcommand{\dzielonadrzedne}[1]{%
337 \subsection*{\typosubsubsection{#1}}%
340 \newcommand{\nazwautworu}[1]{%
341 \section*{\typosection{#1}}%
344 \newcommand{\podtytul}[1]{%
345 \subsection*{\typosubsubsection{#1}}%
348 \newcommand{\translator}[1]{%
349 \subsection*{\typosubsubsection{tłum. #1}}%
353 \newcommand{\powiesc}[1]{#1}
354 \newcommand{\opowiadanie}[1]{#1}
355 \newcommand{\lirykal}[1]{#1}
356 \newcommand{\lirykalp}[1]{#1}
357 \newcommand{\dramatwierszowanyl}[1]{#1}
358 \newcommand{\dramatwierszowanylp}[1]{#1}
359 \newcommand{\dramatwspolczesny}[1]{#1}
361 \newcommand{\nota}[1]{%
365 \newcommand{\dedykacja}[1]{%
373 \newcommand{\dlugicytat}[1]{%
379 \newcommand{\poezjacyt}[1]{%
384 \newcommand{\motto}[1]{%
389 \newcommand{\listaosob}[2]{%
396 \newcommand{\nagloweklisty}[1]{%
397 \typosubsubsection{#1}%
400 \newcommand{\listaosoba}[1]{%
404 \newcommand{\kwestia}[1]{%
408 \newcommand{\naglowekakt}[1]{%
410 \subsection*{\typosubsection{#1}}%
412 \newcommand{\naglowekczesc}[1]{%
414 \subsection*{\typosubsection{#1}}%
416 \newcommand{\srodtytul}[1]{%
417 \subsection*{\typosubsection{#1}}%
420 \newcommand{\naglowekscena}[1]{%
421 \subsubsection*{\typosubsubsection{#1}}%
423 \newcommand{\naglowekrozdzial}[1]{%
424 \subsubsection*{\typosubsubsection{#1}}%
427 \newcommand{\naglowekosoba}[1]{%
428 \par{\textsc{#1}}\nopagebreak%
430 \newcommand{\naglowekpodrozdzial}[1]{%
431 \par{#1}\nopagebreak%
434 \newcommand{\miejsceczas}[1]{%
437 \newcommand{\didaskalia}[1]{%
441 \newcommand{\akap}[1]{%
444 \newcommand{\akapdialog}[1]{%
447 \newcommand{\akapcd}[1]{%
451 \newcommand{\mottopodpis}[1]{%
459 \newcommand{\strofa}[1]{%
460 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
463 \newcommand{\wers}[1]{#1}
465 \newcommand{\wersakap}[1]{%
468 \newcommand{\werscd}[1]{%
471 \newcommand{\werswciety}[2][1em]{%
476 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
477 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
478 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
479 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
481 \newcommand{\pa}[1]{}
482 \newcommand{\pe}[1]{}
483 \newcommand{\pr}[1]{}
484 \newcommand{\pt}[1]{}
487 \newcommand{\mat}[1]{$#1$}
489 \newcommand{\didasktekst}[1]{%
492 \newcommand{\slowoobce}[1]{%
495 \newcommand{\tytuldziela}[1]{%
498 \newcommand{\wyroznienie}[1]{%
502 \newcommand{\osoba}[1]{%
506 \newcommand{\sekcjaswiatlo}{%
510 \newcommand{\sekcjaasterysk}{%
517 \newcommand{\separatorlinia}{%
523 \newcommand{\motyw}[2][0]{%
528 \vspace{-#1\baselineskip}%
529 \raggedright{\hspace{0pt}%
530 \footnotesize{\color{theme}{#2}}}%
531 \vspace{\baselineskip}%