missing conflicts
[librarian.git] / librarian / pdf / wl.cls
1 % -*- coding: utf-8 -*-
2 \NeedsTeXFormat{LaTeX2e}
3 \ProvidesClass{wl}[2011/11/28 wolnelektury.pl book style]
4
5 % PDF customizations
6 %
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
14
15 \RequirePackage{setspace}
16 \RequirePackage{type1cm}
17 \RequirePackage{amssymb}
18 \RequirePackage{amsmath}
19 \DeclareOption{13pt}{%
20 \AtEndOfClass{%
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@
37                \itemsep \parsep}%
38    \belowdisplayskip \abovedisplayskip
39 }%
40 }%
41 }
42
43 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
44
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}}
48
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}}
53
54
55 \newif\ifshowfootnotes \showfootnotestrue
56 \DeclareOption{nofootnotes}{\showfootnotesfalse}
57
58 \newif\ifshowthemes \showthemestrue
59 \DeclareOption{nothemes}{\showthemesfalse}
60
61 \newif\ifenablewlfont \enablewlfonttrue
62 \DeclareOption{nowlfont}{\enablewlfontfalse}
63
64 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
65 \ProcessOptions\relax
66 \LoadClass[a4paper]{book}
67
68
69 \usepackage{trace}
70 \usepackage{caption}
71 \usepackage{tabularx}
72 \usepackage[MeX]{polski}
73 \usepackage{icomma}
74 \usepackage[xetex]{graphicx}
75 \usepackage{fontspec}
76 \usepackage{xunicode}
77 \usepackage{xltxtra}
78
79
80 \usepackage[overload]{textcase}
81 \usepackage{scalefnt}
82 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
83
84 \ifenablewlfont
85 \setmainfont [
86 %ExternalLocation,
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}},
93 Numbers=OldStyle,
94 Scale=1.04,
95 LetterSpace=-1.0
96 ] {JunicodeWL}
97
98 \newfontfamily\alien[
99 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
100 Numbers=OldStyle,
101 Scale=0.85,
102 LetterSpace=-1.0
103 ] {DejaVu Serif}
104
105
106 \defaultfontfeatures{
107 SizeFeatures={
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 }
111 }
112 }
113
114 \renewcommand{\textsc}[1]{%
115 {\addfontfeature{
116 SizeFeatures={
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 }
120 },
121 Letters={SmallCaps,UppercaseSmallCaps}
122 }
123 #1}
124 }
125 \fi% enablewlfont
126
127 %{\Itshape JunicodeWL-Italic.ttf }
128 %{\bfseries Junicode-Bold.ttf }
129 %{\bfseries\itshape Junicode-BoldItalic.ttf }
130
131 \pagestyle{plain}
132 \usepackage{fancyhdr}
133
134 \makeatletter
135
136 % bottom figure below footnotes
137 \usepackage{fnpos}
138 \makeFNabove
139
140 \usepackage{color}
141 \definecolor{theme}{gray}{.3}
142
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}
152
153 \pagestyle{fancy}
154 \fancyhf{}
155 \renewcommand{\headrulewidth}{0pt}
156 \renewcommand{\footrulewidth}{0pt}
157
158 %\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
159 \cfoot{}
160 %\rfoot{{\footnotesize \thepage}}
161 \fancyfoot[LO,RE]{{\footnotesize \textsc{\@author} \emph{\@title}}}
162 \fancyfoot[LE,RO]{{\footnotesize \thepage}}
163
164 \clubpenalty=100000
165 \widowpenalty=100000
166
167
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}}}%}%
176 \usebox{\ximagebox}%
177 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
178
179 \newcommand{\makecover}[2]{
180
181
182         %\pdfpagewidth=#1
183         %\pdfpageheight=#2
184
185         \thispagestyle{empty}
186         \newlength{\PictHOffset}
187         \newlength{\PictVOffset}
188         \setlength{\PictHOffset}{1in}
189         \addtolength{\PictHOffset}{\hoffset}
190         \addtolength{\PictHOffset}{\oddsidemargin}
191
192         \setlength{\PictVOffset}{1in}
193         \addtolength{\PictVOffset}{\voffset}
194         \addtolength{\PictVOffset}{\topmargin}
195         \addtolength{\PictVOffset}{\headheight}
196         \addtolength{\PictVOffset}{\headsep}
197         \addtolength{\PictVOffset}{\topskip}
198
199         \addtolength{\PictVOffset}{-#2}
200
201         \noindent\hspace*{-\PictHOffset}%
202         \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
203             \includegraphics[height=#2,width=#1]{cover.jpg}}}
204         %\clearpage
205         \vspace{#2}
206
207         \hspace{-36mm}\parbox{16cm}{
208         {\addfontfeature{LetterSpace=-4.0}\emph{\scalefont{4}%
209             \noindent Future of Copyright Anthology
210         }}
211
212         \vspace{2em}
213         {\addfontfeature{LetterSpace=-4.0}{\scalefont{1.5}%
214             A collection of texts from a crowd-funded contest.
215         }}
216
217
218         \vspace{8em}
219
220 \emph{\thankyou}\\
221 \indent\emph{You made this book possible.}
222         }
223
224
225         %\setlength{\pdfpagewidth}{210mm}
226         %\setlength{\pdfpageheight}{297mm}
227 }
228
229
230 \renewcommand{\maketitle}{
231     {
232     \thispagestyle{empty}
233     \footnotesize
234     \color{theme}
235
236     \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
237         \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
238     \end{minipage}
239     \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
240
241     \ifflaglessadvertising
242     \else
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}.
245         \vspace{.5em}
246     \fi
247
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}.
250
251     \end{minipage}
252     \noindent \rule{\linewidth}{0.4pt}
253
254     \vspace{.6em}
255     \color{black}
256     }
257 }
258
259 \usepackage{printlen}
260
261 \newcommand{\editorialsection}{
262 \clearpage
263
264 %\set\textwidth=450pt
265 %\printlength\textwidth
266
267
268 {\scalefont{1.5}Dear readers!}
269
270
271
272 \vspace{1em}
273 It is our great pleasure to present you the “Future of Copyright 
274 Anthology”, a collection of 10 best short stories sent in for the “Future 
275 of Copyright” contest organized by Modern Poland Foundation. These works 
276 have been selected by our jury – Prof. Michael Geist, Piotr Czerski and 
277 Jarosław Lipszyc.
278
279 The main prize in this contest was founded by you, the readers, on the 
280 Indiegogo crowdfunding platform. We are proud to announce that this 
281 prize goes to Aymeric Mansoux, author of “Morphology of a copyright 
282 tale”, in appreciation of the originality, power and the strong message 
283 of this work. Moreover, the jury decided to grant an honorable mention 
284 to Togi, author of the work “Give”.
285
286 We would like to thank you for your crowdfunding support and a high
287 standard of the submitted works. We were pleasantly surprised by the
288 interest shown in the competition, and we have decided to hold
289 its second edition next 
290 year. We hope that with your help it will be even more successful and 
291 the collected works will provide a strong voice in the debate on the future 
292 of copyright law and system.
293
294 \vspace{1em}
295 Modern Poland Foundation Team
296
297 \vspace{4em}
298 \includegraphics[scale=.2]{logo.eps}
299 \vspace{1em}
300
301 \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
302
303 %\vspace{4em}
304 %\box{\tableofcontents}
305
306   \begin{figure}[b!]
307   {
308     \footnotesize
309     \color{theme}
310     \noindent \rule{\linewidth}{0.4pt}
311
312     \rightsinfo
313     \vspace{.6em}
314
315     %Źródło: \href{\bookurl}{\bookurl}
316
317     %\vspace{.6em}
318     %\sourceinfo
319
320     %\description
321     %\vspace{.6em}
322
323     Published by \href{http://nowoczesnapolska.org.pl}{Modern Poland Foundation}, 2012.
324
325     \editors
326
327     %\vspace{.6em}
328     \coverby
329
330     \color{black}
331   }
332   \end{figure}
333 }
334
335
336 \newcommand{\typosubsubsection}[1]{%
337 {\textsc{#1}}
338 }
339
340 \newcommand{\typosubsection}[1]{%
341 {\addfontfeature{
342 SizeFeatures={
343   {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
344   {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
345   {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
346 },
347 Letters={Uppercase}
348 }
349 \MakeUppercase{#1}}
350 }
351
352 \newcommand{\typosection}[1]{%
353 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
354 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
355 }
356
357 \newcommand{\tytul}[1]{%
358 #1%
359 %\vspace{1em}%
360 }
361
362 \newcommand{\autorpodutworu}[1]{%
363 \section*{\typosection{#1}}%
364 }
365
366 \newcommand{\nazwapodutworu}[1]{%
367 \section*{\typosection{#1}}%
368 }
369
370 \newcommand{\autorutworu}[1]{%
371 \addcontentsline{toc}{part}{???}
372 \subsection*{\typosubsection{#1}}%
373 }
374
375 \newcommand{\dzielonadrzedne}[1]{%
376 \subsection*{\typosubsubsection{#1}}%
377 }
378
379 \newcommand{\nazwautworu}[1]{%
380 \section*{\typosection{#1}}%
381 }
382
383 \newcommand{\podtytul}[1]{%
384 \subsection*{\typosubsubsection{#1}}%
385 }
386
387 \newcommand{\podtytulpodutworu}[1]{%
388 \subsection*{\typosubsubsection{#1}}%
389 }
390
391 \newcommand{\translator}[1]{%
392 \subsection*{\typosubsubsection{tłum. #1}}%
393 }
394
395 \newcommand{\powiesc}[1]{#1}
396 \newcommand{\opowiadanie}[1]{#1}
397 \newcommand{\lirykal}[1]{#1}
398 \newcommand{\lirykalp}[1]{#1}
399 \newcommand{\dramatwierszowanyl}[1]{#1}
400 \newcommand{\dramatwierszowanylp}[1]{#1}
401 \newcommand{\dramatwspolczesny}[1]{#1}
402
403 \newcommand{\nota}[1]{%
404 \begin{quotation}%
405 #1%
406 \end{quotation}%
407 }
408
409 \newcommand{\dedykacja}[1]{%
410 \begin{em}%
411 \begin{flushright}%
412 #1%
413 \end{flushright}%
414 \end{em}%
415 }
416
417 \newcommand{\dlugicytat}[1]{%
418 \begin{quotation}%
419 #1%
420 \end{quotation}%
421 }
422
423 \newcommand{\poezjacyt}[1]{%
424 \begin{verse}%
425 #1%
426 \end{verse}%
427 }
428 \newcommand{\motto}[1]{%
429 \begin{em}%
430 #1%
431 \end{em}%
432 }
433 \newcommand{\listaosob}[2]{%
434 \par{#1}%
435 \begin{itemize}%
436 #2%
437 \end{itemize}%
438 }
439
440 \newcommand{\nagloweklisty}[1]{%
441 \typosubsubsection{#1}%
442 }
443
444 \newcommand{\listaosoba}[1]{%
445 \item{#1}%
446 }
447
448 \newcommand{\kwestia}[1]{%
449 \par{#1}%
450 }
451
452 \newcommand{\naglowekakt}[1]{%
453 \pagebreak
454 \subsection*{\typosubsection{#1}}%
455 }
456 \newcommand{\naglowekczesc}[1]{%
457 %\pagebreak
458 \subsection*{\typosubsection{#1}}%
459 }
460 \newcommand{\srodtytul}[1]{%
461 \subsection*{\typosubsection{#1}}%
462 }
463
464 \newcommand{\naglowekscena}[1]{%
465 \subsubsection*{\typosubsubsection{#1}}%
466 }
467 \newcommand{\naglowekrozdzial}[1]{%
468 \subsubsection*{\typosubsubsection{#1}}%
469 }
470
471 \newcommand{\naglowekosoba}[1]{%
472 \par{\textsc{#1}}\nopagebreak%
473 }
474 \newcommand{\naglowekpodrozdzial}[1]{%
475 \par{#1}\nopagebreak%
476 }
477
478 \newcommand{\miejsceczas}[1]{%
479 \par{\emph{#1}}%
480 }
481 \newcommand{\didaskalia}[1]{%
482 \par{\emph{#1}}%
483 }
484
485 \newcommand{\akap}[1]{%
486 \par{#1}%
487 }
488 \newcommand{\akapdialog}[1]{%
489 \par{#1}%
490 }
491 \newcommand{\akapcd}[1]{%
492 \par{#1}%
493 }
494
495 \newcommand{\mottopodpis}[1]{%
496 \begin{em}%
497 \begin{flushright}%
498 #1%
499 \end{flushright}%
500 \end{em}%
501 }
502
503 \newcommand{\strofa}[1]{%
504 \par{\noindent{\ignorespaces#1\vspace{1em}}}%
505 }
506
507 \newcommand{\wers}[1]{#1}
508
509 \newcommand{\wersakap}[1]{%
510 \hspace*{1em}#1%
511 }
512 \newcommand{\werscd}[1]{%
513 \hspace*{8em}#1%
514 }
515 \newcommand{\werswciety}[2][1em]{%
516 \hspace*{#1}#2%
517 }
518
519 \ifshowfootnotes
520   \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}}
521   \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
522   \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
523   \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
524 \else
525   \newcommand{\pa}[1]{}
526   \newcommand{\pe}[1]{}
527   \newcommand{\pr}[1]{}
528   \newcommand{\pt}[1]{}
529 \fi
530
531 \newcommand{\mat}[1]{$#1$}
532
533 \newcommand{\didasktekst}[1]{%
534 \emph{#1}%
535 }
536 \newcommand{\slowoobce}[1]{%
537 \emph{#1}%
538 }
539 \newcommand{\tytuldziela}[1]{%
540 \emph{#1}%
541 }
542 \newcommand{\wyroznienie}[1]{%
543 \emph{#1}%
544 }
545
546 \newcommand{\osoba}[1]{%
547 #1%
548 }
549
550 \newcommand{\sekcjaswiatlo}{%
551 \vspace{30pt}%
552 }
553
554 \newcommand{\sekcjaasterysk}{%
555 \vspace{10pt}%
556 \begin{center}%
557 \par{*}%
558 \end{center}%
559 \noindent%
560 }
561
562 \newcommand{\separatorlinia}{%
563 \vspace{10pt}%
564 \hrule{}%
565 \vspace{10pt}%
566 }
567
568 \newcommand{\motyw}[2][0]{%
569 \ifshowthemes
570 \mbox{}%
571 \marginpar{%
572 \vspace{-8pt}%
573 \vspace{-#1\baselineskip}%
574 \raggedright{\hspace{0pt}%
575 \footnotesize{\color{theme}{#2}}}%
576 \vspace{\baselineskip}%
577 }%
578 \fi
579 }
580
581 \newcommand{\ilustr}[2]{
582
583 \vspace{1em}%
584 \begin{center}%
585 \par{\includegraphics[width=\textwidth]{#1}\\#2}%
586 \end{center}%
587 \vspace{1em}%
588 }