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{geometry}
16 \RequirePackage{setspace}
17 \RequirePackage{type1cm}
18 \RequirePackage{amssymb}
19 \RequirePackage{amsmath}
21 %\DeclareOption{13pt}{%
23 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
24 %% \renewcommand\normalsize{%
25 %% \@setfontsize\normalsize{13pt}{14.5pt}%
26 %% \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
27 %% \abovedisplayshortskip \z@ \@plus3\p@
28 %% \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
29 %% \belowdisplayskip \abovedisplayskip
30 %% \let\@listi\@listI}\normalsize%
31 %% \renewcommand\footnotesize{%
32 %% \@setfontsize\footnotesize\@xpt\@xiipt
33 %% \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
34 %% \abovedisplayshortskip \z@ \@plus3\p@
35 %% \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
36 %% \def\@listi{\leftmargin\leftmargini
37 %% \topsep 6\p@ \@plus2\p@ \@minus2\p@
38 %% \parsep 3\p@ \@plus2\p@ \@minus\p@
40 %% \belowdisplayskip \abovedisplayskip
45 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
47 \DeclareOption{defaultleading}{}
48 \DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
49 \DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}}
51 %% 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.
52 \DeclareOption{a5paper}{%
53 \setlength{\paperheight}{210mm}%
54 \setlength{\paperwidth}{148mm}}
55 % a5paper dropped down size
56 \newif\ifafivepaper \afivepaperfalse
57 \DeclareOption{a5paperdd}{%
58 \setlength{\paperheight}{225mm}%
59 \setlength{\paperwidth}{160mm}%
63 \newif\ifshowfootnotes \showfootnotestrue
64 \DeclareOption{nofootnotes}{\showfootnotesfalse}
66 \newif\ifshowthemes \showthemestrue
67 \DeclareOption{nothemes}{\showthemesfalse}
69 \newif\ifenablewlfont \enablewlfonttrue
70 \DeclareOption{nowlfont}{\enablewlfontfalse}
73 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{extbook}}
85 right=30mm]{geometry}%
91 \usepackage[MeX]{polski}
93 \usepackage[xetex]{graphicx}
98 \usepackage[overload]{textcase}
100 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
104 ItalicFont = CrimsonText-Italic,
105 BoldFont = CrimsonText-Bold,
106 BoldItalicFont = CrimsonText-BoldItalic,
107 Ligatures={Common, Contextual},
110 \newfontface\sb{CrimsonText-Semibold}
112 \renewcommand{\baselinestretch}{1.1}
115 \usepackage{fancyhdr}
116 \usepackage[explicit]{titlesec}
122 % bottom figure below footnotes
127 \definecolor{theme}{gray}{.3}
130 %%%%%%%%%%%%%%%%%%%%%% Headings.
134 \renewcommand{\headrulewidth}{0pt}
135 \renewcommand{\footrulewidth}{0pt}
137 %\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
139 %\rfoot{{\footnotesize \thepage}}
140 \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}
141 \fancyhead[CE]{{\textsc{\MakeUppercase{\@title}}}}
142 \fancyhead[CO]{{\textsc{\leftmark}}}
143 \fancyhead[LE,RO]{{\thepage}}
145 %%%%%%%%%%%%%%%%%%%%%% Section title styles.
147 \titleformat{\chapter}%
148 {\raggedright\Huge\sc\addfontfeature{LetterSpace=0.0, Letters={Uppercase}}}%
149 {}{0pt}{\MakeUppercase{#1}}
150 \titlespacing*{\chapter}{0pt}{0pt}{40pt}
153 \titleformat{\section}%
154 {\bf\large\addfontfeature{Scale=1.0}}%
155 {\thesection\enskip}{0pt}{#1}
156 \renewcommand{\thesection}{\Roman{section}}
158 \titleformat{\subsection}%
160 {\thesubsection}{0pt}{#1}
162 \newcommand{\typosubsubsection}[1]{%
167 \newcommand{\typosubsection}[1]{%
171 \newcommand{\typosection}[1]{%
172 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
173 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
175 %%%%%%%%%%%%%%%%%% ^^
177 %%%%% Footnotes %%%%%%%%5
179 %% \renewcommand\@makefntext[1]{%
180 %% \noindent\parbox[t][\height][l]{3em}{\@thefnmark.}\parbox[t][\height][l]{6cm}{#1}\vskip3pt}
184 \renewcommand\@makefnmark{%
185 \hbox{{\normalfont\@thefnmark}}%
187 \renewcommand\thefootnote{[\arabic{footnote}]}
189 \long\def\@makefntext#1{%
190 \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1.
200 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
201 \newsavebox{\ximagebox}\newlength{\ximageheight}
202 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
203 \newcommand{\xbox}[1]
204 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
205 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
206 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
207 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
209 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
211 \newcommand{\makecover}[2]{
215 \thispagestyle{empty}
216 \newlength{\PictHOffset}
217 \newlength{\PictVOffset}
218 \setlength{\PictHOffset}{1in}
219 \addtolength{\PictHOffset}{\hoffset}
220 \addtolength{\PictHOffset}{\oddsidemargin}
222 \setlength{\PictVOffset}{1in}
223 \addtolength{\PictVOffset}{\voffset}
224 \addtolength{\PictVOffset}{\topmargin}
225 \addtolength{\PictVOffset}{\headheight}
226 \addtolength{\PictVOffset}{\headsep}
227 \addtolength{\PictVOffset}{\topskip}
228 \addtolength{\PictVOffset}{-\pdfpageheight}
230 \noindent\hspace*{-\PictHOffset}%
231 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
232 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
236 %% Strona tytułowa %% XXX
237 \hspace{-36mm}\parbox{16cm}{
238 {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
239 \noindent Philippe Aigrain}}
241 {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
242 przy współpracy Suzanne Aigrain
246 {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
251 {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
252 Kultura i gospodarka epoki internetu
256 \setlength{\pdfpagewidth}{210mm}
257 \setlength{\pdfpageheight}{297mm}
261 \renewcommand{\maketitle}{
263 \thispagestyle{empty}
266 \noindent \rule{\linewidth}{0.4pt}
273 \usepackage{printlen}
275 \newcommand{\editorialsection}{
276 %% XXX % sprawdzic czy czegos nie zgubilem z master
277 %% szczegolnie jesli chodzi o makra wstawiajace dane z DC, jak np \editors
278 %% coś tu nie dizała, do zmiany ogólnie
281 %% \thispagestyle{empty}
285 %% \thispagestyle{empty}
288 %% \hspace{0mm}\parbox{16cm}{
290 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
295 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
296 %% Kultura i gospodarka epoki internetu
301 %% \thispagestyle{empty}
304 %% \thispagestyle{empty}
309 %% \hspace{-36mm}\parbox{16cm}{
312 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
313 %% \noindent Philippe Aigrain
316 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
317 %% przy współpracy Suzanne Aigrain
321 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
326 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
327 %% Kultura i gospodarka epoki internetu
331 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{2}%
332 %% Z języka angielskiego przełożył \\
333 %% \emph{Wojciech Pędzich}
338 %% \includegraphics[scale=.2]{logo.eps}
341 %% Przekaż darowiznę na konto:
342 %% \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
345 %% \thispagestyle{empty}
347 %% \noindent Tytuł oryginału
349 %% \noindent \emph{Sharing. Culture and the Economy in the Internet Age}
353 %% \noindent \editors
358 %% \noindent \rightsinfo
362 %% \noindent \coverby
365 %% %\set\textwidth=450pt
366 %% %\printlength\textwidth
369 %% %% {\scalefont{1.5}Drogi czytelniku!}
377 %% \noindent Tłumaczenie książki powstało w ramach projektu "Przyszłość prawa autorskiego" finansowanego przez {\it Trust for Civil Society in Central and Eastern Europe}.
381 %% \noindent \includegraphics[scale=.4]{cce_trust.eps}
385 %% \noindent Wydawca: Fundacja Nowoczesna Polska, Warszawa 2012
388 %% \includegraphics[scale=.2]{logo.eps}
391 %% \noindent \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
396 %% %\box{\tableofcontents}
398 %% %% \begin{figure}[b!]
402 %% %% \noindent \rule{\linewidth}{0.4pt}
405 %% %% % \vspace{.6em}
407 %% %% %Źródło: \href{\bookurl}{\bookurl}
415 %% %% Opublikowano przez \href{http://nowoczesnapolska.org.pl}{Fundację Nowoczesna Polska}, 2012.
431 \newcommand{\tytul}[1]{%
436 \newcommand{\nazwapodutworu}[1]{%
440 \newcommand{\autorutworu}[1]{%
442 %\subsection*{\typosubsection{#1}}%
445 \newcommand{\dzielonadrzedne}[1]{%
449 \newcommand{\nazwautworu}[1]{%
453 \newcommand{\podtytul}[1]{%
454 \subsection*{\typosubsubsection{#1}}%
457 \newcommand{\podtytulpodutworu}[1]{%
458 \subsection*{\typosubsubsection{#1}}%
461 \newcommand{\translator}[1]{%
462 \subsection*{\typosubsubsection{tłum. #1}}%
464 \newcommand{\translatorsline}[1]{%
468 \newcommand{\powiesc}[1]{#1}
469 \newcommand{\opowiadanie}[1]{#1}
470 \newcommand{\lirykal}[1]{#1}
471 \newcommand{\lirykalp}[1]{#1}
472 \newcommand{\dramatwierszowanyl}[1]{#1}
473 \newcommand{\dramatwierszowanylp}[1]{#1}
474 \newcommand{\dramatwspolczesny}[1]{#1}
476 \newcommand{\nota}[1]{%
480 \newcommand{\dedykacja}[1]{%
488 \newcommand{\dlugicytat}[1]{%
494 \newcommand{\poezjacyt}[1]{%
499 \newcommand{\motto}[1]{%
504 \newcommand{\listaosob}[2]{%
511 \newcommand{\nagloweklisty}[1]{%
512 \typosubsubsection{#1}%
515 \newcommand{\listaosoba}[1]{%
519 \newcommand{\kwestia}[1]{%
523 \newcommand{\naglowekakt}[1]{%
525 \subsection*{\typosubsection{#1}}%
527 \newcommand{\naglowekczesc}[1]{%
531 \newcommand{\srodtytul}[1]{%
532 \subsection*{\typosubsection{#1}}%
535 \newcommand{\naglowekscena}[1]{%
536 \subsubsection*{\typosubsubsection{#1}}%
538 \newcommand{\naglowekrozdzial}[1]{%
542 \newcommand{\naglowekosoba}[1]{%
543 \par{\textsc{#1}}\nopagebreak%
545 \newcommand{\naglowekpodrozdzial}[1]{%
546 \section{#1}\nopagebreak%
549 \newcommand{\miejsceczas}[1]{%
552 \newcommand{\didaskalia}[1]{%
556 \newcommand{\akap}[1]{%
559 \newcommand{\akapdialog}[1]{%
562 \newcommand{\akapcd}[1]{%
566 \newcommand{\mottopodpis}[1]{%
574 \newcommand{\strofa}[1]{%
575 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
578 \newcommand{\wers}[1]{#1}
580 \newcommand{\wersakap}[1]{%
583 \newcommand{\werscd}[1]{%
586 \newcommand{\werswciety}[2][1em]{%
591 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
592 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
593 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
594 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
596 \newcommand{\pa}[1]{}
597 \newcommand{\pe}[1]{}
598 \newcommand{\pr}[1]{}
599 \newcommand{\pt}[1]{}
602 \newcommand{\mat}[1]{$#1$}
604 \newcommand{\didasktekst}[1]{%
607 \newcommand{\slowoobce}[1]{%
610 \newcommand{\tytuldziela}[1]{%
613 \newcommand{\wyroznienie}[1]{%
617 \newcommand{\osoba}[1]{%
621 \newcommand{\sekcjaswiatlo}{%
625 \newcommand{\sekcjaasterysk}{%
632 \newcommand{\separatorlinia}{%
638 \newcommand{\motyw}[2][0]{%
643 \vspace{-#1\baselineskip}%
644 \raggedright{\hspace{0pt}%
645 \footnotesize{\color{theme}{#2}}}%
646 \vspace{\baselineskip}%
651 \newcommand{\spistresci}{
656 \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
658 \newcommand{\www}[1]{{\normalfont\href{#1}{#1}}}