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