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}
70 \usepackage{longtable}
72 \usepackage[MeX]{polski}
74 \usepackage[xetex]{graphicx}
79 \usepackage[overload]{textcase}
81 \usepackage[hyphens]{url}
82 %\usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex,unicode]{hyperref}
83 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=blue,xetex,unicode]{hyperref}
88 UprightFont = JunicodeWL-Regular,
89 ItalicFont = JunicodeWL-Italic,
90 BoldFont = JunicodeWL-Regular,
91 BoldItalicFont = JunicodeWL-Italic,
92 SmallCapsFont = JunicodeWL-Regular,
93 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
100 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
107 \defaultfontfeatures{
109 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
110 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
111 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
115 \renewcommand{\textsc}[1]{%
118 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
119 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
120 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
122 Letters={SmallCaps,UppercaseSmallCaps}
128 %{\Itshape JunicodeWL-Italic.ttf }
129 %{\bfseries Junicode-Bold.ttf }
130 %{\bfseries\itshape Junicode-BoldItalic.ttf }
133 \usepackage{fancyhdr}
137 % bottom figure below footnotes
142 \definecolor{theme}{gray}{.3}
144 \setlength{\marginparsep}{2em}
145 \setlength{\marginparwidth}{8.5em}
146 %\setlength{\oddsidemargin}{0pt}
147 \setlength{\oddsidemargin}{\evensidemargin}
148 \setlength{\evensidemargin}{18pt}
149 \setlength{\voffset}{0pt}
150 \setlength{\topmargin}{0pt}
151 \setlength{\headheight}{0pt}
152 \setlength{\headsep}{0pt}
153 \setlength{\textheight}{24cm}
157 \renewcommand{\headrulewidth}{0pt}
158 \renewcommand{\footrulewidth}{0pt}
159 %\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
160 %\rfoot[{\footnotesize \thepage}]{{\footnotesize \textsc{\@author} \emph{\@title}}}
161 \lfoot[{\footnotesize \thepage}]{}
163 %\rfoot{{\footnotesize \thepage}}
164 %\lfoot[{\footnotesize \textsc{\@author} \emph{\@title}}]{{\footnotesize \thepage}}
165 \rfoot[]{{\footnotesize \thepage}}
172 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
173 \newsavebox{\ximagebox}\newlength{\ximageheight}
174 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
175 \newcommand{\xbox}[1]
176 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
177 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
178 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
179 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
181 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
183 \newcommand{\makecover}[2]{
187 \thispagestyle{empty}
188 \newlength{\PictHOffset}
189 \newlength{\PictVOffset}
190 \setlength{\PictHOffset}{1in}
191 \addtolength{\PictHOffset}{\hoffset}
192 \addtolength{\PictHOffset}{\oddsidemargin}
194 \setlength{\PictVOffset}{1in}
195 \addtolength{\PictVOffset}{\voffset}
196 \addtolength{\PictVOffset}{\topmargin}
197 \addtolength{\PictVOffset}{\headheight}
198 \addtolength{\PictVOffset}{\headsep}
199 \addtolength{\PictVOffset}{\topskip}
200 \addtolength{\PictVOffset}{-\pdfpageheight}
202 \noindent\hspace*{-\PictHOffset}%
203 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
204 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
207 \setlength{\pdfpagewidth}{210mm}
208 \setlength{\pdfpageheight}{297mm}
212 \renewcommand{\maketitle}{
214 % \thispagestyle{empty}
220 \noindent \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
221 \href{http://prawokultury.pl}{\xbox{\includegraphics[width=1in]{prawokultury-logo.png}}}
222 %\href{http://koed.org.pl}{\xbox{\includegraphics[height=.55in]{koed-logo.eps}}}
224 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
226 %\xbox{\includegraphics[width=1.6in]{trust-logo.eps}}
227 \href{http://nowoczesnapolska.org.pl}{\xbox{\includegraphics[height=.55in]{fnp-logo.eps}}}
231 % \begin{minipage}[t]{.45\textwidth}\vspace{0pt}
233 \ifflaglessadvertising
235 %\noindent Ten rozdział pochodzi z książki \emph{\@title}, która zostanie opublikowana w portalu
236 %\href{http://prawokultury.pl/}{prawokultury.pl}.
240 % Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
241 % przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
244 \noindent \rule{\linewidth}{0.4pt}
251 \newcommand{\editorialsection}{
256 \noindent \rule{\linewidth}{0.4pt}
261 %Źródło: \href{\bookurl}{\bookurl}
280 \newcommand{\typosubsubsection}[1]{%
284 \newcommand{\typosubsection}[1]{%
287 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
288 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
289 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
296 \newcommand{\typosection}[1]{%
297 %{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
298 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{1.7}#1}}
299 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
303 \newcommand{\tytul}[1]{%
308 \newcommand{\nazwapodutworu}[1]{%
309 \section*{\typosection{#1}}%
312 \newcommand{\autorutworu}[1]{%
313 \subsection*{\typosubsection{#1}}%
316 \newcommand{\dzielonadrzedne}[1]{%
317 \subsection*{\typosubsubsection{#1}}%
320 \newcommand{\nazwautworu}[1]{%
321 \section*{\raggedright{\typosection{#1}}}%
324 \newcommand{\podtytul}[1]{%
325 \subsection*{\typosubsubsection{#1}}%
328 \newcommand{\translator}[1]{%
329 \subsection*{\typosubsubsection{tłum. #1}}%
333 \newcommand{\powiesc}[1]{#1}
334 \newcommand{\opowiadanie}[1]{#1}
335 \newcommand{\lirykal}[1]{#1}
336 \newcommand{\lirykalp}[1]{#1}
337 \newcommand{\dramatwierszowanyl}[1]{#1}
338 \newcommand{\dramatwierszowanylp}[1]{#1}
339 \newcommand{\dramatwspolczesny}[1]{#1}
341 \newcommand{\nota}[1]{%
345 \newcommand{\dedykacja}[1]{%
353 \newlength{\fboxhsep}
354 \newlength{\fboxvsep}
356 \newlength{\fboxtoprule}
357 \newlength{\fboxbottomrule}
358 \newlength{\fboxleftrule}
359 \newlength{\fboxrightrule}
361 \setlength{\fboxhsep}{5\fboxsep}
362 \setlength{\fboxvsep}{20\fboxsep}
364 \setlength{\fboxtoprule}{\fboxrule}
365 \setlength{\fboxleftrule}{\fboxrule}
366 \setlength{\fboxrightrule}{\fboxrule}
367 \setlength{\fboxbottomrule}{\fboxrule}
371 \def\@frameb@xother#1{%
372 \@tempdima\fboxtoprule
373 \advance\@tempdima\fboxvsep
374 \advance\@tempdima\dp\@tempboxa
376 \lower\@tempdima\hbox{%
378 \hrule\@height\fboxtoprule
380 \vrule\@width\fboxleftrule
387 \vrule\@width\fboxrightrule}%
388 \hrule\@height\fboxbottomrule}%
394 \long\def\fboxother#1{%
396 \setbox\@tempboxa\hbox{%
398 \kern\fboxhsep{#1}\kern\fboxhsep
400 \@frameb@xother\relax}
402 \newcommand{\myfbox}[3]{%
404 \setlength{\fboxhsep}{#1}
405 \setlength{\fboxvsep}{#2}
411 \newcommand{\ramka}[1]{%
413 \edef\myindent{\the\parindent}%
414 \noindent\myfbox{1em}{1em}{%
415 \parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{%
416 \setlength{\parindent}{\myindent}%
422 \newcommand{\dlugicytat}[1]{%
429 \newcommand{\poezjacyt}[1]{%
434 \newcommand{\motto}[1]{%
439 \newcommand{\listaosob}[2]{%
447 \newcommand{\nagloweklisty}[1]{%
448 \typosubsubsection{#1}%
451 \newcommand{\listaosoba}[1]{%
455 \newcommand{\kwestia}[1]{%
459 \newcommand{\naglowekakt}[1]{%
461 \subsection*{\typosubsection{#1}}%
463 \newcommand{\naglowekczesc}[1]{%
465 \subsection*{\typosubsection{#1}}%
467 \newcommand{\srodtytul}[1]{%
468 \par{\typosubsubsection{#1}}%
469 %\subsection*{\typosubsection{#1}}%
472 \newcommand{\naglowekscena}[1]{%
473 \subsubsection*{\typosubsubsection{#1}}%
475 \newcommand{\naglowekrozdzial}[1]{%
476 \subsection*{\raggedright \typosubsection{#1}}%
477 %\subsubsection*{\typosubsubsection{#1}}%
480 \newcommand{\naglowekosoba}[1]{%
481 \par{\textsc{#1}}\nopagebreak%
483 \newcommand{\naglowekpodrozdzial}[1]{%
484 \subsubsection*{\typosubsubsection{#1}}%
485 %\par{#1}\nopagebreak%
488 \newcommand{\miejsceczas}[1]{%
491 \newcommand{\didaskalia}[1]{%
495 \newcommand{\akap}[1]{%
498 \newcommand{\akapdialog}[1]{%
501 \newcommand{\akapcd}[1]{%
505 \newcommand{\mottopodpis}[1]{%
513 \newcommand{\strofa}[1]{%
514 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
517 \newcommand{\wers}[1]{#1}
519 \newcommand{\wersakap}[1]{%
522 \newcommand{\werscd}[1]{%
525 \newcommand{\werswciety}[2][1em]{%
530 %\newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
531 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1}}}
532 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
533 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
534 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
536 \newcommand{\pa}[1]{}
537 \newcommand{\pe}[1]{}
538 \newcommand{\pr}[1]{}
539 \newcommand{\pt}[1]{}
542 \newcommand{\mat}[1]{$#1$}
544 \newcommand{\didasktekst}[1]{%
547 \newcommand{\slowoobce}[1]{%
550 \newcommand{\tytuldziela}[1]{%
553 \newcommand{\wyroznienie}[1]{%
557 \newcommand{\osoba}[1]{%
561 \newcommand{\sekcjaswiatlo}{%
565 \newcommand{\sekcjaasterysk}{%
572 \newcommand{\separatorlinia}{%
578 \newcommand{\motyw}[2][0]{%
583 \vspace{-#1\baselineskip}%
584 \raggedright{\hspace{0pt}%
585 \footnotesize{\color{theme}{#2}}}%
586 \vspace{\baselineskip}%
592 \newcommand{\www}[1]{%
596 \newcommand{\listanum}[1]{%
601 \newcommand{\listapunkt}[1]{%
606 \newcommand{\punkt}[1]{%
609 \newcommand{\ilustr}[2]{%
611 \par{\noindent\includegraphics[width=\linewidth]{#1}}%