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}
65 \LoadClass[a4paper]{book}
71 \usepackage[MeX]{polski}
73 \usepackage[xetex]{graphicx}
78 \usepackage[overload]{textcase}
80 \usepackage[hyphens]{url}
81 %\usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex,unicode]{hyperref}
82 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=blue,xetex,unicode]{hyperref}
87 UprightFont = JunicodeWL-Regular,
88 ItalicFont = JunicodeWL-Italic,
89 BoldFont = JunicodeWL-Regular,
90 BoldItalicFont = JunicodeWL-Italic,
91 SmallCapsFont = JunicodeWL-Regular,
92 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
99 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
106 \defaultfontfeatures{
108 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
109 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
110 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
114 \renewcommand{\textsc}[1]{%
117 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
118 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
119 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
121 Letters={SmallCaps,UppercaseSmallCaps}
127 %{\Itshape JunicodeWL-Italic.ttf }
128 %{\bfseries Junicode-Bold.ttf }
129 %{\bfseries\itshape Junicode-BoldItalic.ttf }
132 \usepackage{fancyhdr}
136 % bottom figure below footnotes
141 \definecolor{theme}{gray}{.3}
143 \setlength{\marginparsep}{2em}
144 \setlength{\marginparwidth}{8.5em}
145 \setlength{\oddsidemargin}{0pt}
146 \setlength{\voffset}{0pt}
147 \setlength{\topmargin}{0pt}
148 \setlength{\headheight}{0pt}
149 \setlength{\headsep}{0pt}
150 \setlength{\textheight}{24cm}
154 \renewcommand{\headrulewidth}{0pt}
155 \renewcommand{\footrulewidth}{0pt}
156 % CAUTION! Manually entered text.
157 %\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
158 \rfoot[{\footnotesize \thepage}]{{\footnotesize \textsc{\@author} \emph{Dlaczego nie warto blokować użycia komercyjnego\ldots}}}
160 %\rfoot{{\footnotesize \thepage}}
161 \lfoot[{\footnotesize \textsc{\@author} \emph{Dlaczego nie warto blokować użycia komercyjnego\ldots}}]{{\footnotesize \thepage}}
167 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
168 \newsavebox{\ximagebox}\newlength{\ximageheight}
169 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
170 \newcommand{\xbox}[1]
171 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
172 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
173 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
174 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
176 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
178 \newcommand{\makecover}[2]{
182 \thispagestyle{empty}
183 \newlength{\PictHOffset}
184 \newlength{\PictVOffset}
185 \setlength{\PictHOffset}{1in}
186 \addtolength{\PictHOffset}{\hoffset}
187 \addtolength{\PictHOffset}{\oddsidemargin}
189 \setlength{\PictVOffset}{1in}
190 \addtolength{\PictVOffset}{\voffset}
191 \addtolength{\PictVOffset}{\topmargin}
192 \addtolength{\PictVOffset}{\headheight}
193 \addtolength{\PictVOffset}{\headsep}
194 \addtolength{\PictVOffset}{\topskip}
195 \addtolength{\PictVOffset}{-\pdfpageheight}
197 \noindent\hspace*{-\PictHOffset}%
198 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
199 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
202 \setlength{\pdfpagewidth}{210mm}
203 \setlength{\pdfpageheight}{297mm}
207 \renewcommand{\maketitle}{
209 \thispagestyle{empty}
213 \noindent \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
214 %\href{http://prawokultury.pl}{\xbox{\includegraphics[width=1in]{prawokultury-logo.png}}}
215 \href{http://koed.org.pl}{\xbox{\includegraphics[height=.55in]{koedlogo.png}}}
217 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
219 %\xbox{\includegraphics[width=1.6in]{trust-logo.eps}}
220 \href{http://nowoczesnapolska.org.pl}{\xbox{\includegraphics[height=.55in]{nowoczesnapolska.org.pl.png}}}
224 % \begin{minipage}[t]{.45\textwidth}\vspace{0pt}
226 \ifflaglessadvertising
228 %\noindent Ten rozdział pochodzi z książki \emph{\@title}, która zostanie opublikowana w portalu
229 %\href{http://prawokultury.pl/}{prawokultury.pl}.
233 % Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
234 % przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
237 \noindent \rule{\linewidth}{0.4pt}
244 \newcommand{\editorialsection}{
249 \noindent \rule{\linewidth}{0.4pt}
254 %Źródło: \href{\bookurl}{\bookurl}
273 \newcommand{\typosubsubsection}[1]{%
277 \newcommand{\typosubsection}[1]{%
280 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
281 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
282 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
289 \newcommand{\typosection}[1]{%
290 %{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
291 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{1.7}#1}}
292 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
296 \newcommand{\tytul}[1]{%
301 \newcommand{\nazwapodutworu}[1]{%
302 \section*{\typosection{#1}}%
305 \newcommand{\autorutworu}[1]{%
306 \subsection*{\typosubsection{#1}}%
309 \newcommand{\dzielonadrzedne}[1]{%
310 \subsection*{\typosubsubsection{#1}}%
313 \newcommand{\nazwautworu}[1]{%
314 \section*{\raggedright{\typosection{#1}}}%
317 \newcommand{\podtytul}[1]{%
318 \subsection*{\typosubsubsection{#1}}%
321 \newcommand{\translator}[1]{%
322 \subsection*{\typosubsubsection{tłum. #1}}%
326 \newcommand{\powiesc}[1]{#1}
327 \newcommand{\opowiadanie}[1]{#1}
328 \newcommand{\lirykal}[1]{#1}
329 \newcommand{\lirykalp}[1]{#1}
330 \newcommand{\dramatwierszowanyl}[1]{#1}
331 \newcommand{\dramatwierszowanylp}[1]{#1}
332 \newcommand{\dramatwspolczesny}[1]{#1}
334 \newcommand{\nota}[1]{%
338 \newcommand{\dedykacja}[1]{%
346 \newcommand{\dlugicytat}[1]{%
353 \newcommand{\poezjacyt}[1]{%
358 \newcommand{\motto}[1]{%
363 \newcommand{\listaosob}[2]{%
370 \newcommand{\nagloweklisty}[1]{%
371 \typosubsubsection{#1}%
374 \newcommand{\listaosoba}[1]{%
378 \newcommand{\kwestia}[1]{%
382 \newcommand{\naglowekakt}[1]{%
384 \subsection*{\typosubsection{#1}}%
386 \newcommand{\naglowekczesc}[1]{%
388 \subsection*{\typosubsection{#1}}%
390 \newcommand{\srodtytul}[1]{%
391 \par{\typosubsubsection{#1}}%
392 %\subsection*{\typosubsection{#1}}%
395 \newcommand{\naglowekscena}[1]{%
396 \subsubsection*{\typosubsubsection{#1}}%
398 \newcommand{\naglowekrozdzial}[1]{%
399 \subsection*{\raggedright \typosubsection{#1}}%
400 %\subsubsection*{\typosubsubsection{#1}}%
403 \newcommand{\naglowekosoba}[1]{%
404 \par{\textsc{#1}}\nopagebreak%
406 \newcommand{\naglowekpodrozdzial}[1]{%
407 \subsubsection*{\typosubsubsection{#1}}%
408 %\par{#1}\nopagebreak%
411 \newcommand{\miejsceczas}[1]{%
414 \newcommand{\didaskalia}[1]{%
418 \newcommand{\akap}[1]{%
421 \newcommand{\akapdialog}[1]{%
424 \newcommand{\akapcd}[1]{%
428 \newcommand{\mottopodpis}[1]{%
436 \newcommand{\strofa}[1]{%
437 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
440 \newcommand{\wers}[1]{#1}
442 \newcommand{\wersakap}[1]{%
445 \newcommand{\werscd}[1]{%
448 \newcommand{\werswciety}[2][1em]{%
453 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
454 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
455 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
456 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
458 \newcommand{\pa}[1]{}
459 \newcommand{\pe}[1]{}
460 \newcommand{\pr}[1]{}
461 \newcommand{\pt}[1]{}
464 \newcommand{\mat}[1]{$#1$}
466 \newcommand{\didasktekst}[1]{%
469 \newcommand{\slowoobce}[1]{%
472 \newcommand{\tytuldziela}[1]{%
475 \newcommand{\wyroznienie}[1]{%
479 \newcommand{\osoba}[1]{%
483 \newcommand{\sekcjaswiatlo}{%
487 \newcommand{\sekcjaasterysk}{%
494 \newcommand{\separatorlinia}{%
500 \newcommand{\motyw}[2][0]{%
505 \vspace{-#1\baselineskip}%
506 \raggedright{\hspace{0pt}%
507 \footnotesize{\color{theme}{#2}}}%
508 \vspace{\baselineskip}%
514 \newcommand{\www}[1]{%
518 \newcommand{\listanum}[1]{%
523 \newcommand{\listapunkt}[1]{%
528 \newcommand{\punkt}[1]{%
531 \newcommand{\ilustr}[2]{%
533 \par{\noindent\includegraphics[width=\textwidth]{#1}}%