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 \RequirePackage{wasysym}
18 \DeclareOption{13pt}{%
20 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
21 \renewcommand\normalsize{%
22 \@setfontsize\normalsize{13pt}{14.5pt}%
23 \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
24 \abovedisplayshortskip \z@ \@plus3\p@
25 \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
26 \belowdisplayskip \abovedisplayskip
27 \let\@listi\@listI}\normalsize%
28 \renewcommand\footnotesize{%
29 \@setfontsize\footnotesize\@xpt\@xiipt
30 \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
31 \abovedisplayshortskip \z@ \@plus3\p@
32 \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
33 \def\@listi{\leftmargin\leftmargini
34 \topsep 6\p@ \@plus2\p@ \@minus2\p@
35 \parsep 3\p@ \@plus2\p@ \@minus\p@
37 \belowdisplayskip \abovedisplayskip
42 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
44 \DeclareOption{defaultleading}{}
45 \DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
46 \DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
48 %% 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.
49 \DeclareOption{a5paper}{%
50 \setlength{\paperheight}{210mm}%
51 \setlength{\paperwidth}{148mm}}
54 \newif\ifshowfootnotes \showfootnotestrue
55 \DeclareOption{nofootnotes}{\showfootnotesfalse}
57 \newif\ifshowthemes \showthemestrue
58 \DeclareOption{nothemes}{\showthemesfalse}
60 \newif\ifenablewlfont \enablewlfonttrue
61 \DeclareOption{nowlfont}{\enablewlfontfalse}
63 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
65 \LoadClass[a4paper,oneside]{book}
70 \usepackage[xetex]{graphicx}
75 \usepackage[overload]{textcase}
77 % TODO: link color is a style thing
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}
132 % bottom figure below footnotes
137 \definecolor{theme}{gray}{.3}
139 \setlength{\marginparsep}{2em}
140 \setlength{\marginparwidth}{8.5em}
141 \setlength{\oddsidemargin}{0pt}
142 \setlength{\voffset}{0pt}
143 \setlength{\topmargin}{0pt}
144 \setlength{\headheight}{0pt}
145 \setlength{\headsep}{0pt}
146 \setlength{\textheight}{24cm}
150 \renewcommand{\headrulewidth}{0pt}
151 \renewcommand{\footrulewidth}{0pt}
152 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
154 \rfoot{{\footnotesize \thepage}}
160 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
161 \newsavebox{\ximagebox}\newlength{\ximageheight}
162 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
163 \newcommand{\xbox}[1]
164 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
165 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
166 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
167 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
169 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
173 \newcommand{\typosubsubsection}[1]{%
177 \newcommand{\typosubsection}[1]{%
180 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
181 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
182 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
189 \newcommand{\typosection}[1]{%
190 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
191 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
195 \newcommand{\tytul}[1]{%
200 \newcommand{\nazwapodutworu}[1]{%
201 \section*{\typosection{#1}}%
204 \newcommand{\autorutworu}[1]{%
205 \subsection*{\typosubsection{#1}}%
208 \newcommand{\dzielonadrzedne}[1]{%
209 \subsection*{\typosubsubsection{#1}}%
212 \newcommand{\nazwautworu}[1]{%
213 \section*{\typosection{#1}}%
216 \newcommand{\podtytul}[1]{%
217 \subsection*{\typosubsubsection{#1}}%
220 \newcommand{\translator}[1]{%
221 % TODO: l10n is a style thing
222 \subsection*{\typosubsubsection{tłum. #1}}%
226 \newcommand{\powiesc}[1]{#1}
227 \newcommand{\opowiadanie}[1]{#1}
228 \newcommand{\lirykal}[1]{#1}
229 \newcommand{\lirykalp}[1]{#1}
230 \newcommand{\dramatwierszowanyl}[1]{#1}
231 \newcommand{\dramatwierszowanylp}[1]{#1}
232 \newcommand{\dramatwspolczesny}[1]{#1}
234 \newcommand{\nota}[1]{%
238 \newcommand{\dedykacja}[1]{%
246 \newcommand{\dlugicytat}[1]{%
252 \newcommand{\poezjacyt}[1]{%
257 \newcommand{\motto}[1]{%
262 \newcommand{\listaosob}[2]{%
269 \newcommand{\nagloweklisty}[1]{%
270 \typosubsubsection{#1}%
273 \newcommand{\listaosoba}[1]{%
277 \newcommand{\kwestia}[1]{%
281 \newcommand{\naglowekakt}[1]{%
283 \subsection*{\typosubsection{#1}}%
285 \newcommand{\naglowekczesc}[1]{%
287 \subsection*{\typosubsection{#1}}%
289 \newcommand{\srodtytul}[1]{%
290 \subsection*{\typosubsection{#1}}%
293 \newcommand{\naglowekscena}[1]{%
294 \subsubsection*{\typosubsubsection{#1}}%
296 \newcommand{\naglowekrozdzial}[1]{%
297 \subsubsection*{\typosubsubsection{#1}}%
300 \newcommand{\naglowekosoba}[1]{%
301 \par{\textsc{#1}}\nopagebreak%
303 \newcommand{\naglowekpodrozdzial}[1]{%
304 \par{#1}\nopagebreak%
307 \newcommand{\miejsceczas}[1]{%
310 \newcommand{\didaskalia}[1]{%
314 \newcommand{\akap}[1]{%
317 \newcommand{\akapdialog}[1]{%
320 \newcommand{\akapcd}[1]{%
324 \newcommand{\mottopodpis}[1]{%
332 \newcommand{\strofa}[1]{%
333 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
336 \newcommand{\wers}[1]{#1}
338 \newcommand{\wersakap}[1]{%
341 \newcommand{\werscd}[1]{%
344 \newcommand{\werswciety}[2][1em]{%
349 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1}}}
350 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
351 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
352 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
354 \newcommand{\pa}[1]{}
355 \newcommand{\pe}[1]{}
356 \newcommand{\pr}[1]{}
357 \newcommand{\pt}[1]{}
360 \newcommand{\mat}[1]{$#1$}
362 \newcommand{\didasktekst}[1]{%
365 \newcommand{\slowoobce}[1]{%
368 \newcommand{\tytuldziela}[1]{%
371 \newcommand{\wyroznienie}[1]{%
375 \newcommand{\osoba}[1]{%
379 \newcommand{\sekcjaswiatlo}{%
383 \newcommand{\sekcjaasterysk}{%
390 \newcommand{\separatorlinia}{%
396 \newcommand{\motyw}[2][0]{%
401 \vspace{-#1\baselineskip}%
402 \raggedright{\hspace{0pt}%
403 \footnotesize{\color{theme}{#2}}}%
404 \vspace{\baselineskip}%
411 \newcommand{\activitycounter}[1]{\vspace{1em}\par{\huge{#1}}}
413 \newcommand{\activityinfo}[1]{\begin{flushright}\parbox[t]{2in}{#1}\end{flushright}}
414 \newcommand{\activitytime}[1]{Czas: #1 min \\}
415 \newcommand{\activityform}[1]{Forma: #1 \\}
416 \newcommand{\activitytools}[1]{#1 \\}
418 \newcommand*\checkbox{\item[\Square]}
419 \newcommand*\radio{\item[\Circle]}