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}
253 \newcommand{\typosubsubsection}[1]{%
257 \newcommand{\typosubsection}[1]{%
260 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
261 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
262 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
269 \newcommand{\typosection}[1]{%
270 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
271 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
275 \newcommand{\tytul}[1]{%
280 \newcommand{\nazwapodutworu}[1]{%
281 \section*{\typosection{#1}}%
284 \newcommand{\autorutworu}[1]{%
285 \subsection*{\typosubsection{#1}}%
288 \newcommand{\dzielonadrzedne}[1]{%
289 \subsection*{\typosubsubsection{#1}}%
292 \newcommand{\nazwautworu}[1]{%
293 \section*{\typosection{#1}}%
296 \newcommand{\podtytul}[1]{%
297 \subsection*{\typosubsubsection{#1}}%
300 \newcommand{\translator}[1]{%
301 \subsection*{\typosubsubsection{tłum. #1}}%
305 \newcommand{\powiesc}[1]{#1}
306 \newcommand{\opowiadanie}[1]{#1}
307 \newcommand{\lirykal}[1]{#1}
308 \newcommand{\lirykalp}[1]{#1}
309 \newcommand{\dramatwierszowanyl}[1]{#1}
310 \newcommand{\dramatwierszowanylp}[1]{#1}
311 \newcommand{\dramatwspolczesny}[1]{#1}
313 \newcommand{\nota}[1]{%
317 \newcommand{\dedykacja}[1]{%
325 \newcommand{\dlugicytat}[1]{%
331 \newcommand{\poezjacyt}[1]{%
336 \newcommand{\motto}[1]{%
341 \newcommand{\listaosob}[2]{%
348 \newcommand{\nagloweklisty}[1]{%
349 \typosubsubsection{#1}%
352 \newcommand{\listaosoba}[1]{%
356 \newcommand{\kwestia}[1]{%
360 \newcommand{\naglowekakt}[1]{%
362 \subsection*{\typosubsection{#1}}%
364 \newcommand{\naglowekczesc}[1]{%
366 \subsection*{\typosubsection{#1}}%
368 \newcommand{\srodtytul}[1]{%
369 \subsection*{\typosubsection{#1}}%
372 \newcommand{\naglowekscena}[1]{%
373 \subsubsection*{\typosubsubsection{#1}}%
375 \newcommand{\naglowekrozdzial}[1]{%
376 \subsubsection*{\typosubsubsection{#1}}%
379 \newcommand{\naglowekosoba}[1]{%
380 \par{\textsc{#1}}\nopagebreak%
382 \newcommand{\naglowekpodrozdzial}[1]{%
383 \par{#1}\nopagebreak%
386 \newcommand{\miejsceczas}[1]{%
389 \newcommand{\didaskalia}[1]{%
393 \newcommand{\akap}[1]{%
396 \newcommand{\akapdialog}[1]{%
399 \newcommand{\akapcd}[1]{%
403 \newcommand{\mottopodpis}[1]{%
411 \newcommand{\strofa}[1]{%
412 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
415 \newcommand{\wers}[1]{#1}
417 \newcommand{\wersakap}[1]{%
420 \newcommand{\werscd}[1]{%
423 \newcommand{\werswciety}[2][1em]{%
428 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
429 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
430 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
431 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
433 \newcommand{\pa}[1]{}
434 \newcommand{\pe}[1]{}
435 \newcommand{\pr}[1]{}
436 \newcommand{\pt}[1]{}
439 \newcommand{\mat}[1]{$#1$}
441 \newcommand{\didasktekst}[1]{%
444 \newcommand{\slowoobce}[1]{%
447 \newcommand{\tytuldziela}[1]{%
450 \newcommand{\wyroznienie}[1]{%
454 \newcommand{\osoba}[1]{%
458 \newcommand{\sekcjaswiatlo}{%
462 \newcommand{\sekcjaasterysk}{%
469 \newcommand{\separatorlinia}{%
475 \newcommand{\motyw}[2][0]{%
480 \vspace{-#1\baselineskip}%
481 \raggedright{\hspace{0pt}%
482 \footnotesize{\color{theme}{#2}}}%
483 \vspace{\baselineskip}%