X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/7475946199e7c363fcf125c5b26be173cd4010f3..0f3e12398ddbbb07a71eeafb3f960631777cabdc:/librarian/pdf/wlpub.cls?ds=inline

diff --git a/librarian/pdf/wlpub.cls b/librarian/pdf/wlpub.cls
index d5154e1..f2d3b36 100644
--- a/librarian/pdf/wlpub.cls
+++ b/librarian/pdf/wlpub.cls
@@ -1,6 +1,6 @@
 % -*- coding: utf-8 -*-
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{wl}[2011/11/28 wolnelektury.pl book style]
+\ProvidesClass{wlpub}[2011/11/28 wolnelektury.pl book style]
 
 % PDF customizations
 %
@@ -13,10 +13,14 @@
 % nowlfont - don't use customized WL font
 
 %\RequirePackage{geometry}
+
 \RequirePackage{setspace}
 \RequirePackage{type1cm}
 \RequirePackage{amssymb}
 \RequirePackage{amsmath}
+\RequirePackage{paralist}
+\RequirePackage[normalem]{ulem}
+\RequirePackage{xifthen}
 
 %\DeclareOption{13pt}{%
 %\AtEndOfClass{%
@@ -53,11 +57,11 @@
       \setlength{\paperheight}{210mm}%
       \setlength{\paperwidth}{148mm}}
 % a5paper dropped down size
-\newif\ifafivepaper \afivepaperfalse
+\newif\ifcutafivepaper \cutafivepaperfalse
 \DeclareOption{a5paperdd}{%
   \setlength{\paperheight}{225mm}%
   \setlength{\paperwidth}{160mm}%
-  \afivepapertrue
+  \cutafivepapertrue
 }
 
 \newif\ifshowfootnotes \showfootnotestrue
@@ -73,17 +77,7 @@
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{extbook}}
 \ProcessOptions\relax
 \LoadClass{extbook}
-
-\ifafivepaper
-  \usepackage[%
-    paperwidth=160mm,%
-    paperheight=225mm,%
-    text={117mm,162mm},% 
-    top=30mm,% 
-    headsep=8mm,%
-    left=23mm,%
-    right=30mm]{geometry}%
-\fi
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \usepackage{trace}
 \usepackage{caption}
@@ -95,70 +89,134 @@
 \usepackage{xunicode}
 \usepackage{xltxtra}
 \usepackage{trimspaces}
-
+\usepackage{color}
 \usepackage[overload]{textcase}
 \usepackage{scalefnt}
 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
+\usepackage{fancyhdr}
+\usepackage[explicit]{titlesec}
+%\usepackage{fnpos}
+\usepackage{printlen}
+\usepackage{calc}
+\usepackage[stable]{footmisc}
+
+\pagestyle{plain}
+% bottom figure below footnotes
+%\makeFNabove
+
+
+%%%%%%%%%%%%%%%%%%%%%%% Paper size
+\setlength\baselineskip{7.14pt}
+\ifcutafivepaper
+  \usepackage[%
+    paperwidth=160mm,%
+    paperheight=225mm,%
+    text={117mm,162mm},% 
+    top=30mm,% 
+    headsep=8mm,%
+    left=23mm,%
+    right=30mm]{geometry}%
+\else
+  \usepackage[%
+    top=\dimexpr14.5mm+\baselineskip-16pt\relax, % margin will be smaller to accomodate for bigger header (16pt) 
+    headsep=3\baselineskip,
+    headheight=16pt,
+    bottom=26.3mm,%
+    inner=14.5mm,%
+    outer=22.5mm,%
+    textheight=\dimexpr7.14pt*(32*2+1)\relax,%
+    includehead]{geometry}
+\fi
 
+%%%%%%%%%%%%%%%%%%%%%%%% Fonts
 
-\setmainfont [
+\setmainfont[
 ItalicFont = CrimsonText-Italic,
 BoldFont = CrimsonText-Bold,
 BoldItalicFont = CrimsonText-BoldItalic,
 Ligatures={Common, Contextual},
+SmallCapsFont = CrimsonText-Roman,
+SmallCapsFeatures={Letters=SmallCaps},
 Mapping=tex-text
 ]{CrimsonText-Roman}
 \newfontface\sb{CrimsonText-Semibold}
+\newfontface\intro{Archivo-Black}
 
-\renewcommand{\baselinestretch}{1.1}
-
-\pagestyle{plain}
-\usepackage{fancyhdr}
-\usepackage[explicit]{titlesec}
-
+%% For faking small caps You burn in typographic hell.
 \makeatletter
+\newlength\fake@f
+\newlength\fake@c
+\def\fakesc#1{%
+  \begingroup%
+  \xdef\fake@name{\csname\curr@fontshape/\f@size\endcsname}%
+  \fontsize{\fontdimen8\fake@name}{\baselineskip}\selectfont%
+  \uppercase{#1}%
+  \endgroup%
+}
+\makeatother
 
+\setlength{\parindent}{3mm}
+\setlength{\parskip}{0mm}
 
+\renewcommand{\normalsize}{\fontsize{10.4}{14.28}\addfontfeature{LetterSpace=0.3}\selectfont}
+\renewcommand{\large}{\fontsize{14}{14.28}\addfontfeature{LetterSpace=0.3}\selectfont} % srodtytul
+\renewcommand{\small}{\fontsize{8}{14.28}\addfontfeature{LetterSpace=0.5}\selectfont} % paginy
+\renewcommand{\Large}{\fontsize{15}{21.42}\addfontfeature{LetterSpace=0.1}\selectfont} % tytuÅ rozdziaÅu
+\renewcommand{\huge}{\fontsize{18}{21.6}\addfontfeature{LetterSpace=0.1}\selectfont} % wyimek
+\renewcommand{\Huge}{\fontsize{24}{40}\selectfont} % cover
+\renewcommand{\footnotesize}{\fontsize{9}{10.74}\selectfont}
 
-% bottom figure below footnotes
-\usepackage{fnpos}
-\makeFNabove
 
-\usepackage{color}
+
+\definecolor{stoK}{cmyk}{0,0,0,1}
 \definecolor{theme}{gray}{.3}
+%\color{stoK}
 
 
 %%%%%%%%%%%%%%%%%%%%%% Headings.
-
 \pagestyle{fancy}
 \fancyhf{}
 \renewcommand{\headrulewidth}{0pt}
 \renewcommand{\footrulewidth}{0pt}
-
-%\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
+\makeatletter
+%%%%%%%%%% NagÅÃ³wek normalny
 \cfoot{}
-%\rfoot{{\footnotesize \thepage}}
+% this will go to \leftmark
 \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}
-\fancyhead[CE]{{\textsc{\MakeUppercase{\@title}}}}
-\fancyhead[CO]{{\textsc{\leftmark}}}
-\fancyhead[LE,RO]{{\thepage}}
+\fancyhead[CE]{{\small\MakeUppercase{\@title}}}
+\fancyhead[CO]{{\small\leftmark}}
+\fancyhead[LE,RO]{{\small\intro\thepage}}
+%%%%%%%%%% NagÅÃ³wek pierwszej strony rozdziaÅu
+\fancypagestyle{plain}{%
+\fancyhf{}
+\fancyhead[LE,RO]{{\small\intro\thepage}}
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}}
+\makeatother
 
 %%%%%%%%%%%%%%%%%%%%%% Section title styles.
-%% Sections
-\titleformat{\chapter}%
-{\raggedright\Huge\sc\addfontfeature{LetterSpace=0.0, Letters={Uppercase}}}%
-{}{0pt}{\MakeUppercase{#1}}
-\titlespacing*{\chapter}{0pt}{0pt}{40pt}
+%% Chapters
+\titleformat{\chapter}[block]%
+{\Large\intro\addfontfeature{LetterSpace=0.5,Kerning={Uppercase}}}%
+{}{0pt}{\parbox{80mm}{\raggedright\MakeUppercase{#1}}}
+\newlength{\chapterposcorrection}\newlength{\chapterspaceafter}
+\setlength{\chapterposcorrection}{-\headsep-2\baselineskip}
+\setlength{\chapterspaceafter}{14\baselineskip-14pt}%\f@size of large
+\titlespacing*{\chapter}{0pt}{\chapterposcorrection}{\chapterspaceafter}
 
-%% Subsections
+%% Sections
 \titleformat{\section}%
-{\bf\large\addfontfeature{Scale=1.0}}%
-{\thesection\enskip}{0pt}{#1}
+{\addfontfeature{LetterSpace=0.3}\large}%
+{\thesection{}.}{.5em}{\MakeUppercase{#1}}
+
 \renewcommand{\thesection}{\Roman{section}}
 
-\titleformat{\subsection}%
-{\sc}%
-{\thesubsection}{0pt}{#1}
+\titleformat{\subsection}[runin]%
+{}%
+{\thesubsection{}.}{.5em}{\MakeUppercase{#1}.}[]
+
+\renewcommand{\thesubsection}{\Alph{subsection}}
+\titlespacing*{\subsection}{0pt}{0pt}{.5em}
 
 \newcommand{\typosubsubsection}[1]{%
 {\textsc{#1}}
@@ -175,21 +233,29 @@ Mapping=tex-text
 }
 %%%%%%%%%%%%%%%%%% ^^
 
-%%%%% Footnotes %%%%%%%%5
-%% \makeatletter
-%% \renewcommand\@makefntext[1]{%
-%%   \noindent\parbox[t][\height][l]{3em}{\@thefnmark.}\parbox[t][\height][l]{6cm}{#1}\vskip3pt}
-%% \makeatother
+%%%%% Footnotes (works with footmisc) %%%%%%%%
+\newlength{\footnoteindent}\newlength{\footnoteprespace}
+\setlength{\footnoteindent}{6mm}%{3.5mm}
+\setlength{\footnoteprespace}{0em}
 \makeatletter
 
 \renewcommand\@makefnmark{%
-\hbox{{\normalfont\@thefnmark}}%
+\hspace{\footnoteprespace}
+\hbox{{\normalfont \@thefnmark}}%
 }
 \renewcommand\thefootnote{[\arabic{footnote}]}
 
-\long\def\@makefntext#1{%
-  \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1.
-}
+\setlength{\footnotemargin}{-\footnoteindent-\footnoteprespace-.3em}
+\renewcommand\footnotelayout[1]{%
+  \setlength{\leftskip}{\footnoteindent}#1}
+
+%% \long\def\@makefntext#1{%
+%% \setlength{\leftskip}{\footnoteindent}%
+%% \setlength{\hskip}{-\footnoteindent-\footnoteprespace-.1em}%
+%% \hb@xt@ \dimexpr\footnoteindent+\footnoteprespace%
+%% {\@makefnmark}#1
+%% %  \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1
+%% }
 
 \def\trimspace#1{\trim@spaces{#1}}
 
@@ -211,223 +277,83 @@ Mapping=tex-text
 \usebox{\ximagebox}%
 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
 
-\newcommand{\makecover}[2]{
-        \pdfpagewidth=#1
-        \pdfpageheight=#2
-
-        \thispagestyle{empty}
-        \newlength{\PictHOffset}
-        \newlength{\PictVOffset}
-        \setlength{\PictHOffset}{1in}
-        \addtolength{\PictHOffset}{\hoffset}
-        \addtolength{\PictHOffset}{\oddsidemargin}
-
-        \setlength{\PictVOffset}{1in}
-        \addtolength{\PictVOffset}{\voffset}
-        \addtolength{\PictVOffset}{\topmargin}
-        \addtolength{\PictVOffset}{\headheight}
-        \addtolength{\PictVOffset}{\headsep}
-        \addtolength{\PictVOffset}{\topskip}
-        \addtolength{\PictVOffset}{-\pdfpageheight}
-
-        \noindent\hspace*{-\PictHOffset}%
-        \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
-            \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
-        \clearpage
-
- 
-%% Strona tytuÅowa %% XXX
-       \hspace{-36mm}\parbox{16cm}{
-        {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
-            \noindent Philippe Aigrain}}
-
-       {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
-            przy wspÃ³Åpracy Suzanne Aigrain
-        }}
-
-        \vspace{2em}
-        {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
-            Dzielenie siÄ
-        }}
-        
-        \vspace{2em}
-        {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
-            Kultura i gospodarka epoki internetu
-        }}
-        }
-
-       \setlength{\pdfpagewidth}{210mm}
-       \setlength{\pdfpageheight}{297mm}
-}
-
 
-\renewcommand{\maketitle}{
-    {
-    \thispagestyle{empty}
-    \footnotesize
-    \color{theme}
-    \noindent \rule{\linewidth}{0.4pt}
+\newcommand{\makecover}{
+  %\pdfpagewidth=#1
+  %\pdfpageheight=#2
 
-    \vspace{.6em}
-    \color{black}
-    }
-}
+  \thispagestyle{empty}
+  \newlength{\PictHOffset}
+  \newlength{\PictVOffset}
+  \setlength{\PictHOffset}{1in}
+  \addtolength{\PictHOffset}{\hoffset}
+  \addtolength{\PictHOffset}{\oddsidemargin}
 
-\usepackage{printlen}
+  \setlength{\PictVOffset}{1in}
+  \addtolength{\PictVOffset}{\voffset}
+  \addtolength{\PictVOffset}{\topmargin}
+  \addtolength{\PictVOffset}{\headheight}
+  \addtolength{\PictVOffset}{\headsep}
+  \addtolength{\PictVOffset}{\topskip}
 
-\newcommand{\editorialsection}{
-%% XXX % sprawdzic czy czegos nie zgubilem z master
-%% szczegolnie jesli chodzi o makra wstawiajace dane z DC, jak np \editors
-%% coÅ tu nie dizaÅa, do zmiany ogÃ³lnie
-
-%% \clearpage
-%%         \thispagestyle{empty}
-
-%% % Pusta strona 
-%% \clearpage
-%%         \thispagestyle{empty}
-
-%% \vspace{2em}
-%%       \hspace{0mm}\parbox{16cm}{
-%% \centering
-%%       {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
-%%            Dzielenie siÄ
-%%       }}
-
-%%   \vspace{2em}
-%%          {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
-%%              Kultura i gospodarka epoki internetu
-%%          }}
-%% }
+  \addtolength{\PictVOffset}{-\paperheight}
 
-%% \clearpage
-%%         \thispagestyle{empty}
+  \noindent\hspace*{-\PictHOffset}%
+  \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
+      \includegraphics[height=\paperheight,width=\paperwidth]{cover.jpg}}}
 
-%% \clearpage
-%%         \thispagestyle{empty}
+  }
 
-%% %\parbox{10cm}{
-%% %  \centering
-
-%%   \hspace{-36mm}\parbox{16cm}{
-%% \centering
-
-%%   {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
-%%       \noindent Philippe Aigrain
-%%   }}
-
-%%   {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
-%%       przy wspÃ³Åpracy Suzanne Aigrain
-%%   }}
+\renewcommand{\maketitle}{
+  %\vspace{\paperheight}
+  \newpage
+  \thispagestyle{empty}
+  \begin{center}
+  \intro
+  {
+    \begin{spacing}{1.4}
+    \Huge \noindent \thetitle
+    \end{spacing}
+  }
+  \end{center}
+
+  \vspace{\baselineskip}
   
-%%   \vspace{2em}
-%%          {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
-%%              Dzielenie siÄ
-%%          }}
-         
-%%   \vspace{2em}
-%%          {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
-%%              Kultura i gospodarka epoki internetu
-%%          }}
-
-%%   \vspace{2em}
-%%          {\addfontfeature{LetterSpace=-4.0}{\scalefont{2}%
-%%              Z jÄzyka angielskiego przeÅoÅ¼yÅ \\
-%%              \emph{Wojciech PÄdzich}
-%%          }}
-
-%% \vspace{22em}
-
-%% \includegraphics[scale=.2]{logo.eps}
-%% }
-
-%%     PrzekaÅ¼ darowiznÄ na konto:
-%%     \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegÃ³Åy na stronie Fundacji}.
-
-%% \clearpage
-%%         \thispagestyle{empty}
-
-%% \noindent TytuÅ oryginaÅu
-
-%% \noindent \emph{Sharing. Culture and the Economy in the Internet Age}
-
-%% \vspace{1em}
-
-%% \noindent \editors
-
-%% \vspace{1em}
-
-
-%% \noindent \rightsinfo
-
-%% \vspace{1em}
-
-%% \noindent \coverby
-
-
-%% %\set\textwidth=450pt
-%% %\printlength\textwidth
-
-
-%% %% {\scalefont{1.5}Drogi czytelniku!}
-
-
-
-%% %% \vspace{1em}
-
-%% \vspace{1em}
-
-%% \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}.
-
-%% \vspace{1em}
-
-%% \noindent \includegraphics[scale=.4]{cce_trust.eps}
-
-%% \vspace{1em}
-
-%% \noindent Wydawca: Fundacja Nowoczesna Polska, Warszawa 2012
-
-%% \vspace{1em}
-%% \includegraphics[scale=.2]{logo.eps}
-%% \vspace{1em}
-
-%% \noindent \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
-
-
-
-%% %\vspace{4em}
-%% %\box{\tableofcontents}
-
-%% %%   \begin{figure}[b!]
-%% %%   {
-%% %%     \footnotesize
-%% %%     \color{theme}
-%% %%     \noindent \rule{\linewidth}{0.4pt}
-
-%% %%     \rightsinfo
-%% %% %    \vspace{.6em}
-
-%% %%     %Å¹rÃ³dÅo: \href{\bookurl}{\bookurl}
-
-%% %%     %\vspace{.6em}
-%% %%     %\sourceinfo
-
-%% %%     %\description
-%% %%     %\vspace{.6em}
+  \begin{center}
+    \intro
+    {
+      \huge \noindent 
+      \theauthor
+      
+    }
+  \end{center}
+                  %\emph{\thankyou}\\
+                  %\indent\emph{You made this book possible.}
+  \vspace{7\baselineskip}
+
+  \begin{center}
+    \includegraphics[scale=.2]{logo.eps}
+  \end{center}
+  
+}
 
-%% %%     Opublikowano przez \href{http://nowoczesnapolska.org.pl}{FundacjÄ Nowoczesna Polska}, 2012.
 
-%% %%     \editors
+\newcommand{\editorialsection}{
+  \newpage
+  \thispagestyle{empty}
+  \input{editorial}
+}
 
-%% %%     %\vspace{.6em}
-%% %%     \coverby
-    
-%% %%     \color{black}
-%% %%   }
-%% %%   \end{figure}
-%% \clearpage
-%% }
+\renewcommand*\contentsname{Table of Contents}
+\newcommand{\spistresci}{
+{
+  \intro
+  \setcounter{tocdepth}{0}
+  \tableofcontents
+  \newpage
 }
+}
+
 
 
 
@@ -477,7 +403,11 @@ Mapping=tex-text
 \newcommand{\dramatwspolczesny}[1]{#1}
 
 \newcommand{\nota}[1]{%
-\par{#1}%
+\begin{em}%
+\begin{flushleft}%
+\noindent #1%
+\end{flushleft}%
+\end{em}%
 }
 
 \newcommand{\dedykacja}[1]{%
@@ -532,14 +462,21 @@ Mapping=tex-text
 \part{#1}%
 }
 \newcommand{\srodtytul}[1]{%
-\subsection*{\typosubsection{#1}}%
+\subsection{#1}%
 }
 
 \newcommand{\naglowekscena}[1]{%
 \subsubsection*{\typosubsubsection{#1}}%
 }
+
+\newcommand{\theautorrozdzialu}{}
+
+\newcommand{\autorrozdzialu}[1]{%
+\renewcommand{\theautorrozdzialu}{\newline{}{\normalfont by}\newline#1}
+}
+
 \newcommand{\naglowekrozdzial}[1]{%
-\chapter{#1}%
+\chapter[#1]{#1\theautorrozdzialu{}}\renewcommand{\theautorrozdzialu}{}%
 }
 
 \newcommand{\naglowekosoba}[1]{%
@@ -638,12 +575,17 @@ Mapping=tex-text
 \vspace{10pt}%
 }
 
-\newcommand{\ilustr}[2]{
-  \vspace{1em}%
+\newcommand{\ilustrscale}[0]{1}
+\newcommand{\setilustrscale}[1]{\renewcomand{\ilustrscale}{#1}}
+
+\newcommand{\ilustr}[3][]{
+  \vspace{2\baselineskip}%
   \begin{center}%
-    \par{\includegraphics[width=\textwidth]{\trimspace{#1}}\\#2}%
+    \ifthenelse{\isempty{#1}}%
+    {\par{\includegraphics{\trimspace{#2}}\\#3}}%
+    {\par{\includegraphics[#1]{\trimspace{#2}}\\#3}}%
   \end{center}%
-  \vspace{1em}%
+  \vspace{2\baselineskip}%
 }
 
 
@@ -660,3 +602,16 @@ Mapping=tex-text
 \fi
 }
 
+\newcommand{\lista}[1]{%
+\begin{compactitem}
+#1
+\end{compactitem}
+}
+
+\newcommand{\punkt}[1]{%
+\item #1
+}
+\newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
+
+\newcommand{\www}[1]{{\normalfont\small\href{#1}{#1}}}
+
