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{amssymb}
18 \RequirePackage{amsmath}
19 \DeclareOption{13pt}{%
21 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
22 \renewcommand\normalsize{%
23 \@setfontsize\normalsize{13pt}{14.5pt}%
24 \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
25 \abovedisplayshortskip \z@ \@plus3\p@
26 \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
27 \belowdisplayskip \abovedisplayskip
28 \let\@listi\@listI}\normalsize%
29 \renewcommand\footnotesize{%
30 \@setfontsize\footnotesize\@xpt\@xiipt
31 \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
32 \abovedisplayshortskip \z@ \@plus3\p@
33 \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
34 \def\@listi{\leftmargin\leftmargini
35 \topsep 6\p@ \@plus2\p@ \@minus2\p@
36 \parsep 3\p@ \@plus2\p@ \@minus\p@
38 \belowdisplayskip \abovedisplayskip
43 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
45 \DeclareOption{defaultleading}{}
46 \DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
47 \DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
49 %% 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.
50 \DeclareOption{a5paper}{%
51 \setlength{\paperheight}{210mm}%
52 \setlength{\paperwidth}{148mm}}
55 \newif\ifshowfootnotes \showfootnotestrue
56 \DeclareOption{nofootnotes}{\showfootnotesfalse}
58 \newif\ifshowthemes \showthemestrue
59 \DeclareOption{nothemes}{\showthemesfalse}
61 \newif\ifenablewlfont \enablewlfonttrue
62 \DeclareOption{nowlfont}{\enablewlfontfalse}
64 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
66 \LoadClass[a4paper]{book}
72 \usepackage[MeX]{polski}
74 \usepackage[xetex]{graphicx}
80 \usepackage[overload]{textcase}
82 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{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}{36mm}
146 \setlength{\evensidemargin}{0pt}
147 \setlength{\voffset}{0pt}
148 \setlength{\topmargin}{0pt}
149 \setlength{\headheight}{0pt}
150 \setlength{\headsep}{0pt}
151 \setlength{\textheight}{24cm}
155 \renewcommand{\headrulewidth}{0pt}
156 \renewcommand{\footrulewidth}{0pt}
158 %\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
160 %\rfoot{{\footnotesize \thepage}}
161 \fancyfoot[LO,RE]{{\footnotesize \textsc{\@author} \emph{\@title}}}
162 \fancyfoot[LE,RO]{{\footnotesize \thepage}}
168 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
169 \newsavebox{\ximagebox}\newlength{\ximageheight}
170 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
171 \newcommand{\xbox}[1]
172 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
173 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
174 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
175 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
177 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
179 \newcommand{\makecover}[2]{
185 \thispagestyle{empty}
186 \newlength{\PictHOffset}
187 \newlength{\PictVOffset}
188 \setlength{\PictHOffset}{1in}
189 \addtolength{\PictHOffset}{\hoffset}
190 \addtolength{\PictHOffset}{\oddsidemargin}
192 \setlength{\PictVOffset}{1in}
193 \addtolength{\PictVOffset}{\voffset}
194 \addtolength{\PictVOffset}{\topmargin}
195 \addtolength{\PictVOffset}{\headheight}
196 \addtolength{\PictVOffset}{\headsep}
197 \addtolength{\PictVOffset}{\topskip}
199 \addtolength{\PictVOffset}{-#2}
201 \noindent\hspace*{-\PictHOffset}%
202 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
203 \includegraphics[height=#2,width=#1]{cover.jpg}}}
207 \hspace{-36mm}\parbox{16cm}{
208 {\addfontfeature{LetterSpace=-4.0}\emph{\scalefont{4}%
209 \noindent Philippe Aigrain
213 {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
221 %\indent\emph{You made this book possible.}
225 %\setlength{\pdfpagewidth}{210mm}
226 %\setlength{\pdfpageheight}{297mm}
230 \renewcommand{\maketitle}{
232 \thispagestyle{empty}
236 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
237 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
239 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
241 \ifflaglessadvertising
243 \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
244 \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
248 Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
249 przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
252 \noindent \rule{\linewidth}{0.4pt}
259 \usepackage{printlen}
261 \newcommand{\editorialsection}{
264 %\set\textwidth=450pt
265 %\printlength\textwidth
268 {\scalefont{1.5}Drogi czytelniku!}
275 Zespół Fundacji Nowoczesna Polska
278 \includegraphics[scale=.2]{logo.eps}
281 \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
284 %\box{\tableofcontents}
290 \noindent \rule{\linewidth}{0.4pt}
295 %Źródło: \href{\bookurl}{\bookurl}
303 Opublikowano przez \href{http://nowoczesnapolska.org.pl}{Fundację Nowoczesna Polska}, 2012.
316 \newcommand{\typosubsubsection}[1]{%
320 \newcommand{\typosubsection}[1]{%
323 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
324 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
325 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
332 \newcommand{\typosection}[1]{%
333 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
334 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
337 \newcommand{\tytul}[1]{%
342 \newcommand{\autorpodutworu}[1]{%
343 \section*{\typosection{#1}}%
346 \newcommand{\nazwapodutworu}[1]{%
347 \section*{\typosection{#1}}%
350 \newcommand{\autorutworu}[1]{%
351 \addcontentsline{toc}{part}{???}
352 \subsection*{\typosubsection{#1}}%
355 \newcommand{\dzielonadrzedne}[1]{%
356 \subsection*{\typosubsubsection{#1}}%
359 \newcommand{\nazwautworu}[1]{%
360 \section*{\typosection{#1}}%
363 \newcommand{\podtytul}[1]{%
364 \subsection*{\typosubsubsection{#1}}%
367 \newcommand{\podtytulpodutworu}[1]{%
368 \subsection*{\typosubsubsection{#1}}%
371 \newcommand{\translator}[1]{%
372 \subsection*{\typosubsubsection{tłum. #1}}%
375 \newcommand{\powiesc}[1]{#1}
376 \newcommand{\opowiadanie}[1]{#1}
377 \newcommand{\lirykal}[1]{#1}
378 \newcommand{\lirykalp}[1]{#1}
379 \newcommand{\dramatwierszowanyl}[1]{#1}
380 \newcommand{\dramatwierszowanylp}[1]{#1}
381 \newcommand{\dramatwspolczesny}[1]{#1}
383 \newcommand{\nota}[1]{%
389 \newcommand{\dedykacja}[1]{%
397 \newcommand{\dlugicytat}[1]{%
403 \newcommand{\poezjacyt}[1]{%
408 \newcommand{\motto}[1]{%
413 \newcommand{\listaosob}[2]{%
420 \newcommand{\nagloweklisty}[1]{%
421 \typosubsubsection{#1}%
424 \newcommand{\listaosoba}[1]{%
428 \newcommand{\kwestia}[1]{%
432 \newcommand{\naglowekakt}[1]{%
434 \subsection*{\typosubsection{#1}}%
436 \newcommand{\naglowekczesc}[1]{%
438 \subsection*{\typosubsection{#1}}%
440 \newcommand{\srodtytul}[1]{%
441 \subsection*{\typosubsection{#1}}%
444 \newcommand{\naglowekscena}[1]{%
445 \subsubsection*{\typosubsubsection{#1}}%
447 \newcommand{\naglowekrozdzial}[1]{%
448 \subsubsection*{\typosubsubsection{#1}}%
451 \newcommand{\naglowekosoba}[1]{%
452 \par{\textsc{#1}}\nopagebreak%
454 \newcommand{\naglowekpodrozdzial}[1]{%
455 \par{#1}\nopagebreak%
458 \newcommand{\miejsceczas}[1]{%
461 \newcommand{\didaskalia}[1]{%
465 \newcommand{\akap}[1]{%
468 \newcommand{\akapdialog}[1]{%
471 \newcommand{\akapcd}[1]{%
475 \newcommand{\mottopodpis}[1]{%
483 \newcommand{\strofa}[1]{%
484 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
487 \newcommand{\wers}[1]{#1}
489 \newcommand{\wersakap}[1]{%
492 \newcommand{\werscd}[1]{%
495 \newcommand{\werswciety}[2][1em]{%
500 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
501 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
502 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
503 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
505 \newcommand{\pa}[1]{}
506 \newcommand{\pe}[1]{}
507 \newcommand{\pr}[1]{}
508 \newcommand{\pt}[1]{}
511 \newcommand{\mat}[1]{$#1$}
513 \newcommand{\didasktekst}[1]{%
516 \newcommand{\slowoobce}[1]{%
519 \newcommand{\tytuldziela}[1]{%
522 \newcommand{\wyroznienie}[1]{%
526 \newcommand{\osoba}[1]{%
530 \newcommand{\sekcjaswiatlo}{%
534 \newcommand{\sekcjaasterysk}{%
542 \newcommand{\separatorlinia}{%
548 \newcommand{\motyw}[2][0]{%
553 \vspace{-#1\baselineskip}%
554 \raggedright{\hspace{0pt}%
555 \footnotesize{\color{theme}{#2}}}%
556 \vspace{\baselineskip}%
561 \newcommand{\ilustr}[2]{
565 \par{\includegraphics[width=\textwidth]{#1}\\#2}%