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[xetex]{graphicx}
74 \usepackage[overload]{textcase}
76 % TODO: link color is a style thing
77 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
82 UprightFont = JunicodeWL-Regular,
83 ItalicFont = JunicodeWL-Italic,
84 BoldFont = JunicodeWL-Regular,
85 BoldItalicFont = JunicodeWL-Italic,
86 SmallCapsFont = JunicodeWL-Regular,
87 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
94 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
101 \defaultfontfeatures{
103 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
104 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
105 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
109 \renewcommand{\textsc}[1]{%
112 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
113 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
114 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
116 Letters={SmallCaps,UppercaseSmallCaps}
122 %{\Itshape JunicodeWL-Italic.ttf }
123 %{\bfseries Junicode-Bold.ttf }
124 %{\bfseries\itshape Junicode-BoldItalic.ttf }
127 \usepackage{fancyhdr}
131 % bottom figure below footnotes
136 \definecolor{theme}{gray}{.3}
138 \setlength{\marginparsep}{2em}
139 \setlength{\marginparwidth}{8.5em}
140 \setlength{\oddsidemargin}{0pt}
141 \setlength{\voffset}{0pt}
142 \setlength{\topmargin}{0pt}
143 \setlength{\headheight}{0pt}
144 \setlength{\headsep}{0pt}
145 \setlength{\textheight}{24cm}
149 \renewcommand{\headrulewidth}{0pt}
150 \renewcommand{\footrulewidth}{0pt}
151 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
153 \rfoot{{\footnotesize \thepage}}
159 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
160 \newsavebox{\ximagebox}\newlength{\ximageheight}
161 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
162 \newcommand{\xbox}[1]
163 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
164 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
165 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
166 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
168 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
172 \newcommand{\typosubsubsection}[1]{%
176 \newcommand{\typosubsection}[1]{%
179 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
180 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
181 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
188 \newcommand{\typosection}[1]{%
189 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
190 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
194 \newcommand{\tytul}[1]{%
199 \newcommand{\nazwapodutworu}[1]{%
200 \section*{\typosection{#1}}%
203 \newcommand{\autorutworu}[1]{%
204 \subsection*{\typosubsection{#1}}%
207 \newcommand{\dzielonadrzedne}[1]{%
208 \subsection*{\typosubsubsection{#1}}%
211 \newcommand{\nazwautworu}[1]{%
212 \section*{\typosection{#1}}%
215 \newcommand{\podtytul}[1]{%
216 \subsection*{\typosubsubsection{#1}}%
219 \newcommand{\translator}[1]{%
220 % TODO: l10n is a style thing
221 \subsection*{\typosubsubsection{tłum. #1}}%
225 \newcommand{\powiesc}[1]{#1}
226 \newcommand{\opowiadanie}[1]{#1}
227 \newcommand{\lirykal}[1]{#1}
228 \newcommand{\lirykalp}[1]{#1}
229 \newcommand{\dramatwierszowanyl}[1]{#1}
230 \newcommand{\dramatwierszowanylp}[1]{#1}
231 \newcommand{\dramatwspolczesny}[1]{#1}
233 \newcommand{\nota}[1]{%
237 \newcommand{\dedykacja}[1]{%
245 \newcommand{\dlugicytat}[1]{%
251 \newcommand{\poezjacyt}[1]{%
256 \newcommand{\motto}[1]{%
261 \newcommand{\listaosob}[2]{%
268 \newcommand{\nagloweklisty}[1]{%
269 \typosubsubsection{#1}%
272 \newcommand{\listaosoba}[1]{%
276 \newcommand{\kwestia}[1]{%
280 \newcommand{\naglowekakt}[1]{%
282 \subsection*{\typosubsection{#1}}%
284 \newcommand{\naglowekczesc}[1]{%
286 \subsection*{\typosubsection{#1}}%
288 \newcommand{\srodtytul}[1]{%
289 \subsection*{\typosubsection{#1}}%
292 \newcommand{\naglowekscena}[1]{%
293 \subsubsection*{\typosubsubsection{#1}}%
295 \newcommand{\naglowekrozdzial}[1]{%
296 \subsubsection*{\typosubsubsection{#1}}%
299 \newcommand{\naglowekosoba}[1]{%
300 \par{\textsc{#1}}\nopagebreak%
302 \newcommand{\naglowekpodrozdzial}[1]{%
303 \par{#1}\nopagebreak%
306 \newcommand{\miejsceczas}[1]{%
309 \newcommand{\didaskalia}[1]{%
313 \newcommand{\akap}[1]{%
316 \newcommand{\akapdialog}[1]{%
319 \newcommand{\akapcd}[1]{%
323 \newcommand{\mottopodpis}[1]{%
331 \newcommand{\strofa}[1]{%
332 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
335 \newcommand{\wers}[1]{#1}
337 \newcommand{\wersakap}[1]{%
340 \newcommand{\werscd}[1]{%
343 \newcommand{\werswciety}[2][1em]{%
348 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1}}}
349 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
350 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
351 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
353 \newcommand{\pa}[1]{}
354 \newcommand{\pe}[1]{}
355 \newcommand{\pr}[1]{}
356 \newcommand{\pt}[1]{}
359 \newcommand{\mat}[1]{$#1$}
361 \newcommand{\didasktekst}[1]{%
364 \newcommand{\slowoobce}[1]{%
367 \newcommand{\tytuldziela}[1]{%
370 \newcommand{\wyroznienie}[1]{%
374 \newcommand{\osoba}[1]{%
378 \newcommand{\sekcjaswiatlo}{%
382 \newcommand{\sekcjaasterysk}{%
389 \newcommand{\separatorlinia}{%
395 \newcommand{\motyw}[2][0]{%
400 \vspace{-#1\baselineskip}%
401 \raggedright{\hspace{0pt}%
402 \footnotesize{\color{theme}{#2}}}%
403 \vspace{\baselineskip}%