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