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{fixltx2e}
16 \RequirePackage{setspace}
17 \RequirePackage{type1cm}
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
41 \DeclareOption{16pt}{%
43 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
44 \renewcommand\normalsize{%
45 \@setfontsize\normalsize{16pt}{18pt}%
46 \abovedisplayskip 15\p@ \@plus3\p@ \@minus7\p@
47 \abovedisplayshortskip \z@ \@plus3.5\p@
48 \belowdisplayshortskip 8\p@ \@plus4\p@ \@minus3\p@
49 \belowdisplayskip \abovedisplayskip
50 \let\@listi\@listI}\normalsize%
51 \renewcommand\footnotesize{%
52 \@setfontsize\footnotesize\@xpt\@xiipt
53 \abovedisplayskip 12\p@ \@plus2\p@ \@minus5\p@
54 \abovedisplayshortskip \z@ \@plus3.5\p@
55 \belowdisplayshortskip 7\p@ \@plus3.5\p@ \@minus3\p@
56 \def\@listi{\leftmargin\leftmargini
57 \topsep 7\p@ \@plus2.5\p@ \@minus2.5\p@
58 \parsep 3.5\p@ \@plus2.5\p@ \@minus\p@
60 \belowdisplayskip \abovedisplayskip
65 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
67 \DeclareOption{defaultleading}{}
68 \DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
69 \DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
71 %% 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.
72 \DeclareOption{a5paper}{%
73 \setlength{\paperheight}{210mm}%
74 \setlength{\paperwidth}{148mm}}
77 \newif\ifshowfootnotes \showfootnotestrue
78 \DeclareOption{nofootnotes}{\showfootnotesfalse}
80 \newif\ifshowthemes \showthemestrue
81 \DeclareOption{nothemes}{\showthemesfalse}
83 \newif\ifenablewlfont \enablewlfonttrue
84 \DeclareOption{nowlfont}{\enablewlfontfalse}
86 \newif\ifshowtoc \showtoctrue
87 \DeclareOption{notoc}{\showtocfalse}
89 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
91 \LoadClass[a4paper,oneside]{book}
96 \usepackage[MeX]{polski}
98 \usepackage[xetex]{graphicx}
100 \usepackage{xunicode}
103 \usepackage{longtable}
105 \usepackage{unicode-math}
106 \setmathfont{Latin Modern Math}
108 \usepackage[overload]{textcase}
109 \usepackage{scalefnt}
110 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
112 \newfontfamily\alien[
113 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
122 UprightFont = JunicodeWL-Regular,
123 ItalicFont = JunicodeWL-Italic,
124 BoldFont = JunicodeWL-Regular,
125 BoldItalicFont = JunicodeWL-Italic,
126 SmallCapsFont = JunicodeWL-Regular,
127 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
133 \defaultfontfeatures{
135 {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
136 {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
137 {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
141 \renewcommand{\textsc}[1]{%
144 {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
145 {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
146 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
148 Letters={SmallCaps,UppercaseSmallCaps}
154 %{\Itshape JunicodeWL-Italic.ttf }
155 %{\bfseries Junicode-Bold.ttf }
156 %{\bfseries\itshape Junicode-BoldItalic.ttf }
159 \usepackage{fancyhdr}
160 \usepackage{marginnote}
165 % bottom figure below footnotes
170 \definecolor{theme}{gray}{.3}
172 \setlength{\marginparsep}{2em}
173 \setlength{\marginparwidth}{8.5em}
174 \setlength{\oddsidemargin}{0pt}
175 \setlength{\voffset}{0pt}
176 \setlength{\topmargin}{0pt}
177 \setlength{\headheight}{0pt}
178 \setlength{\headsep}{0pt}
179 \setlength{\textheight}{24cm}
183 \renewcommand{\headrulewidth}{0pt}
184 \renewcommand{\footrulewidth}{0pt}
185 \lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
187 \rfoot{{\footnotesize \thepage}}
193 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
194 \newsavebox{\ximagebox}\newlength{\ximageheight}
195 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
196 \newcommand{\xbox}[1]
197 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
198 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
199 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
200 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
202 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
204 \newcommand{\makecover}[2]{
208 \thispagestyle{empty}
209 \newlength{\PictHOffset}
210 \newlength{\PictVOffset}
211 \setlength{\PictHOffset}{1in}
212 \addtolength{\PictHOffset}{\hoffset}
213 \addtolength{\PictHOffset}{\oddsidemargin}
215 \setlength{\PictVOffset}{1in}
216 \addtolength{\PictVOffset}{\voffset}
217 \addtolength{\PictVOffset}{\topmargin}
218 \addtolength{\PictVOffset}{\headheight}
219 \addtolength{\PictVOffset}{\headsep}
220 \addtolength{\PictVOffset}{\topskip}
221 \addtolength{\PictVOffset}{-\pdfpageheight}
223 \noindent\hspace*{-\PictHOffset}%
224 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
225 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
228 \setlength{\pdfpagewidth}{210mm}
229 \setlength{\pdfpageheight}{297mm}
233 \renewcommand{\maketitle}{
235 \thispagestyle{empty}
239 \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
240 \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
242 \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
244 \ifflaglessadvertising
246 \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
247 \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
256 Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
257 przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
260 \noindent \rule{\linewidth}{0.4pt}
267 \newcommand{\editorialsection}{
272 \noindent \rule{\linewidth}{0.4pt}
284 Źródło: \href{\bookurl}{\bookurl}
312 \emph{Wesprzyj Wolne Lektury!}
314 Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
315 pożytku publicznego działającej na rzecz wolności korzystania
318 Co roku do domeny publicznej przechodzi twórczość kolejnych autorów.
319 Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie.
322 \emph{Jak możesz pomóc?}
324 Przekaż 1\% podatku na rozwój Wolnych Lektur:
325 Fundacja Nowoczesna Polska, KRS 0000070056.
327 Pomóż uwolnić konkretną książkę, wspierając
328 \href{http://www.wolnelektury.pl/wesprzyj/}{zbiórkę na stronie wolnelektury.pl}.
330 Przekaż darowiznę na konto:
331 \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
339 \newcommand{\typosubsubsection}[1]{%
343 \newcommand{\typosubsection}[1]{%
346 {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
347 {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
348 {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
355 \newcommand{\typosection}[1]{%
356 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
357 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
361 \DeclareRobustCommand\authortoctext[1]{%
362 {\addvspace{10pt}\nopagebreak\leftskip0em\relax
363 \rightskip \@tocrmarg\relax
364 \noindent\itshape#1\par}}
366 \newcommand\authortoc[1]{%
367 \gdef\chapterauthor{#1}%
368 \addtocontents{toc}{\authortoctext{#1}}}
371 \newcommand{\tytul}[1]{%
376 \newcommand{\nazwapodutworu}[2]{%
378 \section*{\typosection{#1}}%
379 \addcontentsline{toc}{section}{#2}%
382 \newcommand{\nazwanadpodutworu}[2]{%
384 \nazwapodutworu{#1}{#2}%
388 \newcommand{\autorutworu}[1]{%
389 \subsection*{\typosubsection{#1}}%
392 \newcommand{\autorpodutworu}[1]{%
394 \subsection*{\typosubsection{#1}}%
398 \newcommand{\dzielonadrzedne}[1]{%
399 \subsection*{\typosubsubsection{#1}}%
402 \newcommand{\nazwautworu}[1]{%
404 \section*{\typosection{#1}}%
407 \newcommand{\podtytul}[1]{%
408 \subsection*{\typosubsubsection{#1}}%
411 \newcommand{\translator}[1]{%
412 \subsection*{\typosubsubsection{tłum. #1}}%
416 \newcommand{\powiesc}[1]{#1}
417 \newcommand{\opowiadanie}[1]{#1}
418 \newcommand{\lirykal}[1]{#1}
419 \newcommand{\lirykalp}[1]{#1}
420 \newcommand{\dramatwierszowanyl}[1]{#1}
421 \newcommand{\dramatwierszowanylp}[1]{#1}
422 \newcommand{\dramatwspolczesny}[1]{#1}
424 \newcommand{\nota}[1]{%
425 \par{\raggedleft \emph{#1}}%
429 \newcommand{\dedykacja}[1]{%
437 \newlength{\fboxhsep}
438 \newlength{\fboxvsep}
440 \newlength{\fboxtoprule}
441 \newlength{\fboxbottomrule}
442 \newlength{\fboxleftrule}
443 \newlength{\fboxrightrule}
445 \setlength{\fboxhsep}{5\fboxsep}
446 \setlength{\fboxvsep}{20\fboxsep}
448 \setlength{\fboxtoprule}{\fboxrule}
449 \setlength{\fboxleftrule}{\fboxrule}
450 \setlength{\fboxrightrule}{\fboxrule}
451 \setlength{\fboxbottomrule}{\fboxrule}
455 \def\@frameb@xother#1{%
456 \@tempdima\fboxtoprule
457 \advance\@tempdima\fboxvsep
458 \advance\@tempdima\dp\@tempboxa
460 \lower\@tempdima\hbox{%
462 \hrule\@height\fboxtoprule
464 \vrule\@width\fboxleftrule
471 \vrule\@width\fboxrightrule}%
472 \hrule\@height\fboxbottomrule}%
478 \long\def\fboxother#1{%
480 \setbox\@tempboxa\hbox{%
482 \kern\fboxhsep{#1}\kern\fboxhsep
484 \@frameb@xother\relax}
486 \newcommand{\myfbox}[3]{%
488 \setlength{\fboxhsep}{#1}
489 \setlength{\fboxvsep}{#2}
495 \newcommand{\ramka}[1]{%
497 \edef\myindent{\the\parindent}%
498 \noindent\myfbox{1em}{1em}{%
499 \parbox{\dimexpr \textwidth - 2\fboxhsep - 2\fboxrule\relax}{%
500 \setlength{\parindent}{\myindent}%
506 \newcommand{\dlugicytat}[1]{%
512 \newcommand{\poezjacyt}[1]{%
517 \newcommand{\motto}[1]{%
522 \newcommand{\listaosob}[2]{%
529 \newcommand{\nagloweklisty}[1]{%
530 \typosubsubsection{#1}%
533 \newcommand{\listaosoba}[1]{%
537 \newcommand{\kwestia}[1]{%
541 \newcommand{\naglowekakt}[2]{%
543 \subsection*{\typosubsection{\huge #1}}%
544 \addcontentsline{toc}{subsection}{#2}%
547 \newcommand{\naglowekczesc}[2]{%
549 \subsection*{\typosubsection{\huge #1}}%
550 \addcontentsline{toc}{subsection}{#2}%
553 \newcommand{\srodtytul}[1]{%
554 \subsection*{\typosubsection{#1}}%
557 \newcommand{\naglowekscena}[2]{%
558 \subsubsection*{\typosubsubsection{\LARGE #1}}%
559 \addcontentsline{toc}{subsubsection}{#2}%
562 \newcommand{\naglowekrozdzial}[2]{%
563 \subsubsection*{\typosubsubsection{\LARGE #1}}%
564 \addcontentsline{toc}{subsubsection}{#2}%
568 \newcommand{\naglowekosoba}[1]{%
570 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
572 \newcommand{\naglowekpodrozdzial}[1]{%
573 \vspace{5ex}\par{#1}\nopagebreak%
576 \newcommand{\miejsceczas}[1]{%
579 \newcommand{\didaskalia}[1]{%
585 \definecolor{gray}{RGB}{200,200,200}
587 \newlength{\parnumwidth}
588 \setlength{\parnumwidth}{3em}
590 \leavevmode\refstepcounter{parnum}\reversemarginpar%
591 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
594 \leavevmode\refstepcounter{parnum}\reversemarginpar%
595 \ifnum\intcalcMod{\value{parnum}}{5}=0%
596 \marginnote{\textcolor{gray}{\small{\theparnum}}}%
597 \fi\reversemarginpar}
601 \newcommand{\akap}[1]{%
604 \newcommand{\akapdialog}[1]{%
607 \newcommand{\akapcd}[1]{%
611 \newcommand{\mottopodpis}[1]{%
619 \newcommand{\strofa}[1]{%
620 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
623 \newcommand{\wers}[1]{\Nw#1}
625 \newcommand{\wersakap}[1]{%
628 \newcommand{\werscd}[1]{%
631 \newcommand{\werswciety}[2][1em]{%
634 \newcommand{\wersdoprawej}[1]{%
635 \Nw\hspace*{\fill}#1%
639 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
640 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1 [przypis edytorski]}}}
641 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1 [przypis redakcyjny]}}}
642 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1 [przypis tłumacza]}}}
644 \newcommand{\pa}[1]{}
645 \newcommand{\pe}[1]{}
646 \newcommand{\pr}[1]{}
647 \newcommand{\pt}[1]{}
650 \newcommand{\mat}[1]{$#1$}
652 \newcommand{\didasktekst}[1]{%
655 \newcommand{\slowoobce}[1]{%
658 \newcommand{\tytuldziela}[1]{%
661 \newcommand{\wyroznienie}[1]{%
664 \newcommand{\indeksdolny}[1]{%
667 \newcommand{\wiekszeodstepy}[1]{%
668 \spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax%
670 \spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax%
673 \newcommand{\osoba}[1]{%
674 {\scshape \MakeLowercase{#1}}%
677 \newcommand{\sekcjaswiatlo}{%
681 \newcommand{\sekcjaasterysk}{%
688 \newcommand{\separatorlinia}{%
694 \newcommand{\motyw}[2][0]{%
699 \vspace{-#1\baselineskip}%
700 \raggedright{\hspace{0pt}%
701 \footnotesize{\color{theme}{#2}}}%
702 \vspace{\baselineskip}%
707 \newcommand{\ilustr}[2]{%
709 \par{\noindent\includegraphics[width=\linewidth]{#1}}%