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}
97 \usepackage{trimspaces}
99 \usepackage[overload]{textcase}
100 \usepackage{scalefnt}
101 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
105 ItalicFont = CrimsonText-Italic,
106 BoldFont = CrimsonText-Bold,
107 BoldItalicFont = CrimsonText-BoldItalic,
108 Ligatures={Common, Contextual},
111 \newfontface\sb{CrimsonText-Semibold}
113 \renewcommand{\baselinestretch}{1.1}
116 \usepackage{fancyhdr}
117 \usepackage[explicit]{titlesec}
123 % bottom figure below footnotes
128 \definecolor{theme}{gray}{.3}
131 %%%%%%%%%%%%%%%%%%%%%% Headings.
135 \renewcommand{\headrulewidth}{0pt}
136 \renewcommand{\footrulewidth}{0pt}
138 %\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
140 %\rfoot{{\footnotesize \thepage}}
141 \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}
142 \fancyhead[CE]{{\textsc{\MakeUppercase{\@title}}}}
143 \fancyhead[CO]{{\textsc{\leftmark}}}
144 \fancyhead[LE,RO]{{\thepage}}
146 %%%%%%%%%%%%%%%%%%%%%% Section title styles.
148 \titleformat{\chapter}%
149 {\raggedright\Huge\sc\addfontfeature{LetterSpace=0.0, Letters={Uppercase}}}%
150 {}{0pt}{\MakeUppercase{#1}}
151 \titlespacing*{\chapter}{0pt}{0pt}{40pt}
154 \titleformat{\section}%
155 {\bf\large\addfontfeature{Scale=1.0}}%
156 {\thesection\enskip}{0pt}{#1}
157 \renewcommand{\thesection}{\Roman{section}}
159 \titleformat{\subsection}%
161 {\thesubsection}{0pt}{#1}
163 \newcommand{\typosubsubsection}[1]{%
168 \newcommand{\typosubsection}[1]{%
172 \newcommand{\typosection}[1]{%
173 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
174 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
176 %%%%%%%%%%%%%%%%%% ^^
178 %%%%% Footnotes %%%%%%%%5
180 %% \renewcommand\@makefntext[1]{%
181 %% \noindent\parbox[t][\height][l]{3em}{\@thefnmark.}\parbox[t][\height][l]{6cm}{#1}\vskip3pt}
185 \renewcommand\@makefnmark{%
186 \hbox{{\normalfont\@thefnmark}}%
188 \renewcommand\thefootnote{[\arabic{footnote}]}
190 \long\def\@makefntext#1{%
191 \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1.
194 \def\trimspace#1{\trim@spaces{#1}}
203 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
204 \newsavebox{\ximagebox}\newlength{\ximageheight}
205 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
206 \newcommand{\xbox}[1]
207 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
208 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
209 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
210 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
212 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
214 \newcommand{\makecover}[2]{
218 \thispagestyle{empty}
219 \newlength{\PictHOffset}
220 \newlength{\PictVOffset}
221 \setlength{\PictHOffset}{1in}
222 \addtolength{\PictHOffset}{\hoffset}
223 \addtolength{\PictHOffset}{\oddsidemargin}
225 \setlength{\PictVOffset}{1in}
226 \addtolength{\PictVOffset}{\voffset}
227 \addtolength{\PictVOffset}{\topmargin}
228 \addtolength{\PictVOffset}{\headheight}
229 \addtolength{\PictVOffset}{\headsep}
230 \addtolength{\PictVOffset}{\topskip}
231 \addtolength{\PictVOffset}{-\pdfpageheight}
233 \noindent\hspace*{-\PictHOffset}%
234 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
235 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
239 %% Strona tytułowa %% XXX
240 \hspace{-36mm}\parbox{16cm}{
241 {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
242 \noindent Philippe Aigrain}}
244 {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
245 przy współpracy Suzanne Aigrain
249 {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
254 {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
255 Kultura i gospodarka epoki internetu
259 \setlength{\pdfpagewidth}{210mm}
260 \setlength{\pdfpageheight}{297mm}
264 \renewcommand{\maketitle}{
266 \thispagestyle{empty}
269 \noindent \rule{\linewidth}{0.4pt}
276 \usepackage{printlen}
278 \newcommand{\editorialsection}{
279 %% XXX % sprawdzic czy czegos nie zgubilem z master
280 %% szczegolnie jesli chodzi o makra wstawiajace dane z DC, jak np \editors
281 %% coś tu nie dizała, do zmiany ogólnie
284 %% \thispagestyle{empty}
288 %% \thispagestyle{empty}
291 %% \hspace{0mm}\parbox{16cm}{
293 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
298 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
299 %% Kultura i gospodarka epoki internetu
304 %% \thispagestyle{empty}
307 %% \thispagestyle{empty}
312 %% \hspace{-36mm}\parbox{16cm}{
315 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
316 %% \noindent Philippe Aigrain
319 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
320 %% przy współpracy Suzanne Aigrain
324 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
329 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
330 %% Kultura i gospodarka epoki internetu
334 %% {\addfontfeature{LetterSpace=-4.0}{\scalefont{2}%
335 %% Z języka angielskiego przełożył \\
336 %% \emph{Wojciech Pędzich}
341 %% \includegraphics[scale=.2]{logo.eps}
344 %% Przekaż darowiznę na konto:
345 %% \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
348 %% \thispagestyle{empty}
350 %% \noindent Tytuł oryginału
352 %% \noindent \emph{Sharing. Culture and the Economy in the Internet Age}
356 %% \noindent \editors
361 %% \noindent \rightsinfo
365 %% \noindent \coverby
368 %% %\set\textwidth=450pt
369 %% %\printlength\textwidth
372 %% %% {\scalefont{1.5}Drogi czytelniku!}
380 %% \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}.
384 %% \noindent \includegraphics[scale=.4]{cce_trust.eps}
388 %% \noindent Wydawca: Fundacja Nowoczesna Polska, Warszawa 2012
391 %% \includegraphics[scale=.2]{logo.eps}
394 %% \noindent \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
399 %% %\box{\tableofcontents}
401 %% %% \begin{figure}[b!]
405 %% %% \noindent \rule{\linewidth}{0.4pt}
408 %% %% % \vspace{.6em}
410 %% %% %Źródło: \href{\bookurl}{\bookurl}
418 %% %% Opublikowano przez \href{http://nowoczesnapolska.org.pl}{Fundację Nowoczesna Polska}, 2012.
434 \newcommand{\tytul}[1]{%
439 \newcommand{\nazwapodutworu}[1]{%
443 \newcommand{\autorutworu}[1]{%
445 %\subsection*{\typosubsection{#1}}%
448 \newcommand{\dzielonadrzedne}[1]{%
452 \newcommand{\nazwautworu}[1]{%
456 \newcommand{\podtytul}[1]{%
457 \subsection*{\typosubsubsection{#1}}%
460 \newcommand{\podtytulpodutworu}[1]{%
461 \subsection*{\typosubsubsection{#1}}%
464 \newcommand{\translator}[1]{%
465 \subsection*{\typosubsubsection{tłum. #1}}%
467 \newcommand{\translatorsline}[1]{%
471 \newcommand{\powiesc}[1]{#1}
472 \newcommand{\opowiadanie}[1]{#1}
473 \newcommand{\lirykal}[1]{#1}
474 \newcommand{\lirykalp}[1]{#1}
475 \newcommand{\dramatwierszowanyl}[1]{#1}
476 \newcommand{\dramatwierszowanylp}[1]{#1}
477 \newcommand{\dramatwspolczesny}[1]{#1}
479 \newcommand{\nota}[1]{%
483 \newcommand{\dedykacja}[1]{%
491 \newcommand{\dlugicytat}[1]{%
497 \newcommand{\poezjacyt}[1]{%
502 \newcommand{\motto}[1]{%
507 \newcommand{\listaosob}[2]{%
514 \newcommand{\nagloweklisty}[1]{%
515 \typosubsubsection{#1}%
518 \newcommand{\listaosoba}[1]{%
522 \newcommand{\kwestia}[1]{%
526 \newcommand{\naglowekakt}[1]{%
528 \subsection*{\typosubsection{#1}}%
530 \newcommand{\naglowekczesc}[1]{%
534 \newcommand{\srodtytul}[1]{%
535 \subsection*{\typosubsection{#1}}%
538 \newcommand{\naglowekscena}[1]{%
539 \subsubsection*{\typosubsubsection{#1}}%
541 \newcommand{\naglowekrozdzial}[1]{%
545 \newcommand{\naglowekosoba}[1]{%
546 \par{\textsc{#1}}\nopagebreak%
548 \newcommand{\naglowekpodrozdzial}[1]{%
549 \section{#1}\nopagebreak%
552 \newcommand{\miejsceczas}[1]{%
555 \newcommand{\didaskalia}[1]{%
559 \newcommand{\akap}[1]{%
562 \newcommand{\akapdialog}[1]{%
565 \newcommand{\akapcd}[1]{%
569 \newcommand{\mottopodpis}[1]{%
577 \newcommand{\strofa}[1]{%
578 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
581 \newcommand{\wers}[1]{#1}
583 \newcommand{\wersakap}[1]{%
586 \newcommand{\werscd}[1]{%
589 \newcommand{\werswciety}[2][1em]{%
594 \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
595 \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
596 \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
597 \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
599 \newcommand{\pa}[1]{}
600 \newcommand{\pe}[1]{}
601 \newcommand{\pr}[1]{}
602 \newcommand{\pt}[1]{}
605 \newcommand{\mat}[1]{$#1$}
607 \newcommand{\didasktekst}[1]{%
610 \newcommand{\slowoobce}[1]{%
613 \newcommand{\tytuldziela}[1]{%
616 \newcommand{\wyroznienie}[1]{%
620 \newcommand{\osoba}[1]{%
624 \newcommand{\sekcjaswiatlo}{%
628 \newcommand{\sekcjaasterysk}{%
635 \newcommand{\separatorlinia}{%
641 \newcommand{\ilustr}[2]{
644 \par{\includegraphics[width=\textwidth]{\trimspace{#1}}\\#2}%
650 \newcommand{\motyw}[2][0]{%
655 \vspace{-#1\baselineskip}%
656 \raggedright{\hspace{0pt}%
657 \footnotesize{\color{theme}{#2}}}%
658 \vspace{\baselineskip}%