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 % onehalfleading - leading of 1.5 (interlinia)
10 % doubleleading - double leading (interlinia)
11 % a4paper,... - paper size as required by LaTeX
12 % nowlfont - don't use customized WL font
14 \RequirePackage{setspace}
15 \RequirePackage{type1cm}
16 \DeclareOption{13pt}{%
18 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
19 \renewcommand\normalsize{%
20 \@setfontsize\normalsize{13pt}{14.5pt}%
21 \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
22 \abovedisplayshortskip \z@ \@plus3\p@
23 \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
24 \belowdisplayskip \abovedisplayskip
25 \let\@listi\@listI}\normalsize%
26 \renewcommand\footnotesize{%
27 \@setfontsize\footnotesize\@xpt\@xiipt
28 \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
29 \abovedisplayshortskip \z@ \@plus3\p@
30 \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
31 \def\@listi{\leftmargin\leftmargini
32 \topsep 6\p@ \@plus2\p@ \@minus2\p@
33 \parsep 3\p@ \@plus2\p@ \@minus\p@
35 \belowdisplayskip \abovedisplayskip
40 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
42 \DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
43 \DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
45 %% 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.
46 \DeclareOption{a5paper}{%
47 \setlength{\paperheight}{210mm}%
48 \setlength{\paperwidth}{148mm}}
51 \newif\ifshowfootnotes \showfootnotestrue
52 \DeclareOption{nofootnotes}{\showfootnotesfalse}
54 \newif\ifshowthemes \showthemestrue
55 \DeclareOption{nothemes}{\showthemesfalse}
57 \newif\ifenablewlfont \enablewlfonttrue
58 \DeclareOption{nowlfont}{\enablewlfontfalse}
60 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
62 \LoadClass[a4paper,oneside]{book}
67 \usepackage[MeX]{polski}
69 \usepackage[xetex]{graphicx}
74 \usepackage[overload]{textcase}
76 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
81 UprightFont = JunicodeWL-Regular,
82 ItalicFont = JunicodeWL-Italic,
83 BoldFont = JunicodeWL-Regular,
84 BoldItalicFont = JunicodeWL-Italic,
85 SmallCapsFont = JunicodeWL-Regular,
86 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
93 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
100 \defaultfontfeatures{
102 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
103 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
104 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
108 \renewcommand{\textsc}[1]{%
111 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
112 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
113 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
115 Letters={SmallCaps,UppercaseSmallCaps}
121 %{\Itshape JunicodeWL-Italic.ttf }
122 %{\bfseries Junicode-Bold.ttf }
123 %{\bfseries\itshape Junicode-BoldItalic.ttf }
126 \usepackage{fancyhdr}
130 % bottom figure below footnotes
135 \definecolor{theme}{gray}{.3}
137 \setlength{\marginparsep}{2em}
138 \setlength{\marginparwidth}{8.5em}
139 \setlength{\oddsidemargin}{0pt}
140 \setlength{\voffset}{0pt}
141 \setlength{\topmargin}{0pt}
142 \setlength{\headheight}{0pt}
143 \setlength{\headsep}{0pt}
144 \setlength{\textheight}{24cm}
148 \renewcommand{\headrulewidth}{0pt}
149 \renewcommand{\footrulewidth}{0pt}
150 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
152 \rfoot{{\footnotesize \thepage}}
158 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
159 \newsavebox{\ximagebox}\newlength{\ximageheight}
160 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
161 \newcommand{\xbox}[1]
162 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
163 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
164 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
165 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
167 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
169 \newcommand{\makecover}[2]{
173 \thispagestyle{empty}
174 \newlength{\PictHOffset}
175 \newlength{\PictVOffset}
176 \setlength{\PictHOffset}{1in}
177 \addtolength{\PictHOffset}{\hoffset}
178 \addtolength{\PictHOffset}{\oddsidemargin}
180 \setlength{\PictVOffset}{1in}
181 \addtolength{\PictVOffset}{\voffset}
182 \addtolength{\PictVOffset}{\topmargin}
183 \addtolength{\PictVOffset}{\headheight}
184 \addtolength{\PictVOffset}{\headsep}
185 \addtolength{\PictVOffset}{\topskip}
186 \addtolength{\PictVOffset}{-\pdfpageheight}
188 \noindent\hspace*{-\PictHOffset}%
189 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
190 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
193 \setlength{\pdfpagewidth}{210mm}
194 \setlength{\pdfpageheight}{297mm}
198 \renewcommand{\maketitle}{
200 \thispagestyle{empty}
204 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
205 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
207 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
209 \ifflaglessadvertising
211 \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
212 \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
216 Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
217 przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
220 \noindent \rule{\linewidth}{0.4pt}
227 \newcommand{\editorialsection}{
232 \noindent \rule{\linewidth}{0.4pt}
237 Źródło: \href{\bookurl}{\bookurl}
256 \newcommand{\typosubsubsection}[1]{%
260 \newcommand{\typosubsection}[1]{%
263 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
264 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
265 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
272 \newcommand{\typosection}[1]{%
273 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
274 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
278 \newcommand{\tytul}[1]{%
283 \newcommand{\nazwapodutworu}[1]{%
284 \section*{\typosection{#1}}%
287 \newcommand{\autorutworu}[1]{%
288 \subsection*{\typosubsection{#1}}%
291 \newcommand{\dzielonadrzedne}[1]{%
292 \subsection*{\typosubsubsection{#1}}%
295 \newcommand{\nazwautworu}[1]{%
296 \section*{\typosection{#1}}%
299 \newcommand{\podtytul}[1]{%
300 \subsection*{\typosubsubsection{#1}}%
303 \newcommand{\translator}[1]{%
304 \subsection*{\typosubsubsection{tłum. #1}}%
308 \newcommand{\powiesc}[1]{#1}
309 \newcommand{\opowiadanie}[1]{#1}
310 \newcommand{\lirykal}[1]{#1}
311 \newcommand{\lirykalp}[1]{#1}
312 \newcommand{\dramatwierszowanyl}[1]{#1}
313 \newcommand{\dramatwierszowanylp}[1]{#1}
314 \newcommand{\dramatwspolczesny}[1]{#1}
316 \newcommand{\nota}[1]{%
320 \newcommand{\dedykacja}[1]{%
328 \newcommand{\dlugicytat}[1]{%
334 \newcommand{\poezjacyt}[1]{%
339 \newcommand{\motto}[1]{%
344 \newcommand{\listaosob}[2]{%
351 \newcommand{\nagloweklisty}[1]{%
352 \typosubsubsection{#1}%
355 \newcommand{\listaosoba}[1]{%
359 \newcommand{\kwestia}[1]{%
363 \newcommand{\naglowekakt}[1]{%
365 \subsection*{\typosubsection{#1}}%
367 \newcommand{\naglowekczesc}[1]{%
369 \subsection*{\typosubsection{#1}}%
371 \newcommand{\srodtytul}[1]{%
372 \subsection*{\typosubsection{#1}}%
375 \newcommand{\naglowekscena}[1]{%
376 \subsubsection*{\typosubsubsection{#1}}%
378 \newcommand{\naglowekrozdzial}[1]{%
379 \subsubsection*{\typosubsubsection{#1}}%
382 \newcommand{\naglowekosoba}[1]{%
383 \par{\textsc{#1}}\nopagebreak%
385 \newcommand{\naglowekpodrozdzial}[1]{%
386 \par{#1}\nopagebreak%
389 \newcommand{\miejsceczas}[1]{%
392 \newcommand{\didaskalia}[1]{%
396 \newcommand{\akap}[1]{%
399 \newcommand{\akapdialog}[1]{%
402 \newcommand{\akapcd}[1]{%
406 \newcommand{\mottopodpis}[1]{%
414 \newcommand{\strofa}[1]{%
415 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
418 \newcommand{\wers}[1]{#1}
420 \newcommand{\wersakap}[1]{%
423 \newcommand{\werscd}[1]{%
426 \newcommand{\werswciety}[2][1em]{%
431 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
432 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
433 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
434 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
436 \newcommand{\pa}[1]{}
437 \newcommand{\pe}[1]{}
438 \newcommand{\pr}[1]{}
439 \newcommand{\pt}[1]{}
442 \newcommand{\mat}[1]{$#1$}
444 \newcommand{\didasktekst}[1]{%
447 \newcommand{\slowoobce}[1]{%
450 \newcommand{\tytuldziela}[1]{%
453 \newcommand{\wyroznienie}[1]{%
457 \newcommand{\osoba}[1]{%
461 \newcommand{\sekcjaswiatlo}{%
465 \newcommand{\sekcjaasterysk}{%
472 \newcommand{\separatorlinia}{%
478 \newcommand{\motyw}[2][0]{%
483 \vspace{-#1\baselineskip}%
484 \raggedright{\hspace{0pt}%
485 \footnotesize{\color{theme}{#2}}}%
486 \vspace{\baselineskip}%