almost done
authorMarcin Koziej <marcinkoziej@nowoczesnapolska.org.pl>
Thu, 22 Aug 2013 16:27:30 +0000 (18:27 +0200)
committerMarcin Koziej <marcinkoziej@nowoczesnapolska.org.pl>
Thu, 22 Aug 2013 16:27:41 +0000 (18:27 +0200)
librarian/pdf/wl.cls
librarian/pdf/wl2tex.xslt
librarian/pdf/wlpub.cls
scripts/book2pdf

index cb53a3f..05f2aba 100644 (file)
 % a4paper,... - paper size as required by LaTeX
 % nowlfont - don't use customized WL font
 
+%\RequirePackage{geometry}
 \RequirePackage{setspace}
 \RequirePackage{type1cm}
 \RequirePackage{amssymb}
 \RequirePackage{amsmath}
 
-\DeclareOption{13pt}{%
-\AtEndOfClass{%
+%\DeclareOption{13pt}{%
+%\AtEndOfClass{%
 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
-\renewcommand\normalsize{%
-   \@setfontsize\normalsize{13pt}{14.5pt}%
-   \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
-   \abovedisplayshortskip \z@ \@plus3\p@
-   \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
-   \belowdisplayskip \abovedisplayskip
-   \let\@listi\@listI}\normalsize%
-\renewcommand\footnotesize{%
-   \@setfontsize\footnotesize\@xpt\@xiipt
-   \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
-   \abovedisplayshortskip \z@ \@plus3\p@
-   \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
-   \def\@listi{\leftmargin\leftmargini
-               \topsep 6\p@ \@plus2\p@ \@minus2\p@
-               \parsep 3\p@ \@plus2\p@ \@minus\p@
-               \itemsep \parsep}%
-   \belowdisplayskip \abovedisplayskip
-}%
-}%
-}
+%% \renewcommand\normalsize{%
+%%    \@setfontsize\normalsize{13pt}{14.5pt}%
+%%    \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
+%%    \abovedisplayshortskip \z@ \@plus3\p@
+%%    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
+%%    \belowdisplayskip \abovedisplayskip
+%%    \let\@listi\@listI}\normalsize%
+%% \renewcommand\footnotesize{%
+%%    \@setfontsize\footnotesize\@xpt\@xiipt
+%%    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+%%    \abovedisplayshortskip \z@ \@plus3\p@
+%%    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
+%%    \def\@listi{\leftmargin\leftmargini
+%%                \topsep 6\p@ \@plus2\p@ \@minus2\p@
+%%                \parsep 3\p@ \@plus2\p@ \@minus\p@
+%%                \itemsep \parsep}%
+%%    \belowdisplayskip \abovedisplayskip
+%}%
+%}%
+%}
 
 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
 
 \DeclareOption{a5paper}{%
       \setlength{\paperheight}{210mm}%
       \setlength{\paperwidth}{148mm}}
-
+% a5paper dropped down size
+\newif\ifafivepaper \afivepaperfalse
+\DeclareOption{a5paperdd}{%
+  \setlength{\paperheight}{225mm}%
+  \setlength{\paperwidth}{160mm}%
+  \afivepapertrue
+}
 
 \newif\ifshowfootnotes \showfootnotestrue
 \DeclareOption{nofootnotes}{\showfootnotesfalse}
 \newif\ifenablewlfont \enablewlfonttrue
 \DeclareOption{nowlfont}{\enablewlfontfalse}
 
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
-\ProcessOptions\relax
-\LoadClass[a4paper]{book}
 
+\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}
 \usepackage{scalefnt}
 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
 
-\ifenablewlfont
+
 \setmainfont [
-%ExternalLocation,
-UprightFont = JunicodeWL-Regular,
-ItalicFont = JunicodeWL-Italic,
-BoldFont = JunicodeWL-Regular,
-BoldItalicFont = JunicodeWL-Italic,
-SmallCapsFont = JunicodeWL-Regular,
-SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
-Numbers=OldStyle,
-Scale=1.04,
-LetterSpace=-1.0
-] {JunicodeWL}
-
-\newfontfamily\alien[
-SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
-Numbers=OldStyle,
-Scale=0.85,
-LetterSpace=-1.0
-] {DejaVu Serif}
-
-
-\defaultfontfeatures{
-SizeFeatures={
-  {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
-  {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 },
-  {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 }
-}
-}
-
-\renewcommand{\textsc}[1]{%
-{\addfontfeature{
-SizeFeatures={
-  {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
-  {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 },
-  {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
-},
-Letters={SmallCaps,UppercaseSmallCaps}
-}
-#1}
-}
-\fi% enablewlfont
-
-%{\Itshape JunicodeWL-Italic.ttf }
-%{\bfseries Junicode-Bold.ttf }
-%{\bfseries\itshape Junicode-BoldItalic.ttf }
+ItalicFont = CrimsonText-Italic,
+BoldFont = CrimsonText-Bold,
+BoldItalicFont = CrimsonText-BoldItalic,
+Ligatures={Common, Contextual},
+Mapping=tex-text
+]{CrimsonText-Roman}
+\newfontface\sb{CrimsonText-Semibold}
+
+\renewcommand{\baselinestretch}{1.1}
 
 \pagestyle{plain}
 \usepackage{fancyhdr}
+\usepackage[explicit]{titlesec}
 
 \makeatletter
 
+
+
 % bottom figure below footnotes
 \usepackage{fnpos}
 \makeFNabove
@@ -140,15 +126,8 @@ Letters={SmallCaps,UppercaseSmallCaps}
 \usepackage{color}
 \definecolor{theme}{gray}{.3}
 
-\setlength{\marginparsep}{2em}
-\setlength{\marginparwidth}{8.5em}
-\setlength{\oddsidemargin}{36mm}
-\setlength{\evensidemargin}{0pt}
-\setlength{\voffset}{0pt}
-\setlength{\topmargin}{0pt}
-\setlength{\headheight}{0pt}
-\setlength{\headsep}{0pt}
-\setlength{\textheight}{24cm}
+
+%%%%%%%%%%%%%%%%%%%%%% Headings.
 
 \pagestyle{fancy}
 \fancyhf{}
@@ -158,8 +137,61 @@ Letters={SmallCaps,UppercaseSmallCaps}
 %\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
 \cfoot{}
 %\rfoot{{\footnotesize \thepage}}
-\fancyfoot[LO,RE]{{\footnotesize \textsc{\@author} \emph{\@title}}}
-\fancyfoot[LE,RO]{{\footnotesize \thepage}}
+\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}
+\fancyhead[CE]{{\textsc{\MakeUppercase{\@title}}}}
+\fancyhead[CO]{{\textsc{\leftmark}}}
+\fancyhead[LE,RO]{{\thepage}}
+
+%%%%%%%%%%%%%%%%%%%%%% Section title styles.
+%% Sections
+\titleformat{\chapter}%
+{\raggedright\Huge\sc\addfontfeature{LetterSpace=0.0, Letters={Uppercase}}}%
+{}{0pt}{\MakeUppercase{#1}}
+\titlespacing*{\chapter}{0pt}{0pt}{40pt}
+
+%% Subsections
+\titleformat{\section}%
+{\bf\large\addfontfeature{Scale=1.0}}%
+{\thesection\enskip}{0pt}{#1}
+\renewcommand{\thesection}{\Roman{section}}
+
+\titleformat{\subsection}%
+{\sc}%
+{\thesubsection}{0pt}{#1}
+
+\newcommand{\typosubsubsection}[1]{%
+{\textsc{#1}}
+}
+
+%% XXX delete them
+\newcommand{\typosubsection}[1]{%
+{\MakeUppercase{#1}}
+}
+
+\newcommand{\typosection}[1]{%
+{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
+%{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
+}
+%%%%%%%%%%%%%%%%%% ^^
+
+%%%%% Footnotes %%%%%%%%5
+%% \makeatletter
+%% \renewcommand\@makefntext[1]{%
+%%   \noindent\parbox[t][\height][l]{3em}{\@thefnmark.}\parbox[t][\height][l]{6cm}{#1}\vskip3pt}
+%% \makeatother
+\makeatletter
+
+\renewcommand\@makefnmark{%
+\hbox{{\normalfont\@thefnmark}}%
+}
+\renewcommand\thefootnote{[\arabic{footnote}]}
+
+\long\def\@makefntext#1{%
+  \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1.
+}
+
+\makeatother
+
 
 \clubpenalty=100000
 \widowpenalty=100000
@@ -231,23 +263,6 @@ Letters={SmallCaps,UppercaseSmallCaps}
     \thispagestyle{empty}
     \footnotesize
     \color{theme}
-
-    \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt}
-        \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}}
-    \end{minipage}
-    \begin{minipage}[t]{.65\textwidth}\vspace{0pt}
-
-    \ifflaglessadvertising
-    \else
-        \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie
-        \href{http://www.wolnelektury.pl/}{wolnelektury.pl}.
-        \vspace{.5em}
-    \fi
-
-    Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury}
-    przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}.
-
-    \end{minipage}
     \noindent \rule{\linewidth}{0.4pt}
 
     \vspace{.6em}
@@ -260,175 +275,157 @@ Letters={SmallCaps,UppercaseSmallCaps}
 \newcommand{\editorialsection}{
 %% XXX % sprawdzic czy czegos nie zgubilem z master
 %% szczegolnie jesli chodzi o makra wstawiajace dane z DC, jak np \editors
-\clearpage
-        \thispagestyle{empty}
+%% coś tu nie dizała, do zmiany ogólnie
 
-% Pusta strona 
-\clearpage
-        \thispagestyle{empty}
+%% \clearpage
+%%         \thispagestyle{empty}
 
-\vspace{2em}
-      \hspace{0mm}\parbox{16cm}{
-\centering
-      {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
-           Dzielenie się
-      }}
+%% % Pusta strona 
+%% \clearpage
+%%         \thispagestyle{empty}
 
-  \vspace{2em}
-         {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
-             Kultura i gospodarka epoki internetu
-         }}
-}
+%% \vspace{2em}
+%%       \hspace{0mm}\parbox{16cm}{
+%% \centering
+%%       {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
+%%            Dzielenie się
+%%       }}
 
-\clearpage
-        \thispagestyle{empty}
+%%   \vspace{2em}
+%%          {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
+%%              Kultura i gospodarka epoki internetu
+%%          }}
+%% }
 
-\clearpage
-        \thispagestyle{empty}
+%% \clearpage
+%%         \thispagestyle{empty}
 
-%\parbox{10cm}{
-%  \centering
+%% \clearpage
+%%         \thispagestyle{empty}
 
-  \hspace{-36mm}\parbox{16cm}{
-\centering
+%% %\parbox{10cm}{
+%% %  \centering
 
-  {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
-      \noindent Philippe Aigrain
-  }}
+%%   \hspace{-36mm}\parbox{16cm}{
+%% \centering
 
-  {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
-      przy współpracy Suzanne Aigrain
-  }}
+%%   {\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{6}%
+%%              Dzielenie się
+%%          }}
          
-  \vspace{2em}
-         {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
-             Kultura i gospodarka epoki internetu
-         }}
+%%   \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{2em}
+%%          {\addfontfeature{LetterSpace=-4.0}{\scalefont{2}%
+%%              Z języka angielskiego przełożył \\
+%%              \emph{Wojciech Pędzich}
+%%          }}
 
-\vspace{22em}
+%% \vspace{22em}
 
-\includegraphics[scale=.2]{logo.eps}
-}
+%% \includegraphics[scale=.2]{logo.eps}
+%% }
 
-    Przekaż darowiznę na konto:
-    \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
+%%     Przekaż darowiznę na konto:
+%%     \href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
 
-\clearpage
-        \thispagestyle{empty}
+%% \clearpage
+%%         \thispagestyle{empty}
+
+%% \noindent Tytuł oryginału
 
-\noindent Tytuł oryginału
+%% \noindent \emph{Sharing. Culture and the Economy in the Internet Age}
 
-\noindent \emph{Sharing. Culture and the Economy in the Internet Age}
+%% \vspace{1em}
 
-\vspace{1em}
+%% \noindent \editors
 
-\noindent \editors
+%% \vspace{1em}
 
-\vspace{1em}
 
+%% \noindent \rightsinfo
 
-\noindent \rightsinfo
+%% \vspace{1em}
 
-\vspace{1em}
+%% \noindent \coverby
 
-\noindent \coverby
 
+%% %\set\textwidth=450pt
+%% %\printlength\textwidth
 
-%\set\textwidth=450pt
-%\printlength\textwidth
 
+%% %% {\scalefont{1.5}Drogi czytelniku!}
 
-%% {\scalefont{1.5}Drogi czytelniku!}
 
 
+%% %% \vspace{1em}
 
 %% \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}.
 
-\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}
+%% \vspace{1em}
 
-\noindent \includegraphics[scale=.4]{cce_trust.eps}
+%% \noindent \includegraphics[scale=.4]{cce_trust.eps}
 
-\vspace{1em}
+%% \vspace{1em}
 
-\noindent Wydawca: Fundacja Nowoczesna Polska, Warszawa 2012
+%% \noindent Wydawca: Fundacja Nowoczesna Polska, Warszawa 2012
 
-\vspace{1em}
-\includegraphics[scale=.2]{logo.eps}
-\vspace{1em}
+%% \vspace{1em}
+%% \includegraphics[scale=.2]{logo.eps}
+%% \vspace{1em}
 
-\noindent \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
+%% \noindent \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
 
 
 
-%\vspace{4em}
-%\box{\tableofcontents}
+%% %\vspace{4em}
+%% %\box{\tableofcontents}
 
-%%   \begin{figure}[b!]
-%%   {
-%%     \footnotesize
-%%     \color{theme}
-%%     \noindent \rule{\linewidth}{0.4pt}
+%% %%   \begin{figure}[b!]
+%% %%   {
+%% %%     \footnotesize
+%% %%     \color{theme}
+%% %%     \noindent \rule{\linewidth}{0.4pt}
 
-%%     \rightsinfo
-%% %    \vspace{.6em}
+%% %%     \rightsinfo
+%% %% %    \vspace{.6em}
 
-%%     %Źródło: \href{\bookurl}{\bookurl}
+%% %%     %Źródło: \href{\bookurl}{\bookurl}
 
-%%     %\vspace{.6em}
-%%     %\sourceinfo
+%% %%     %\vspace{.6em}
+%% %%     %\sourceinfo
 
-%%     %\description
-%%     %\vspace{.6em}
+%% %%     %\description
+%% %%     %\vspace{.6em}
 
-%%     Opublikowano przez \href{http://nowoczesnapolska.org.pl}{Fundację Nowoczesna Polska}, 2012.
+%% %%     Opublikowano przez \href{http://nowoczesnapolska.org.pl}{Fundację Nowoczesna Polska}, 2012.
 
-%%     \editors
+%% %%     \editors
 
-%%     %\vspace{.6em}
-%%     \coverby
+%% %%     %\vspace{.6em}
+%% %%     \coverby
     
-%%     \color{black}
-%%   }
-%%   \end{figure}
-\clearpage
-}
-
-
-\newcommand{\typosubsubsection}[1]{%
-{\textsc{#1}}
+%% %%     \color{black}
+%% %%   }
+%% %%   \end{figure}
+%% \clearpage
+%% }
 }
 
-\newcommand{\typosubsection}[1]{%
-{\addfontfeature{
-SizeFeatures={
-  {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
-  {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 },
-  {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 }
-},
-Letters={Uppercase}
-}
-\MakeUppercase{#1}}
-}
-
-\newcommand{\typosection}[1]{%
-{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
-%{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
-}
 
 
 \newcommand{\tytul}[1]{%
@@ -437,19 +434,20 @@ Letters={Uppercase}
 }
 
 \newcommand{\nazwapodutworu}[1]{%
-\section*{\typosection{#1}}%
+\section*{#1}%
 }
 
 \newcommand{\autorutworu}[1]{%
-\subsection*{\typosubsection{#1}}%
+#1
+%\subsection*{\typosubsection{#1}}%
 }
 
 \newcommand{\dzielonadrzedne}[1]{%
-\subsection*{\typosubsubsection{#1}}%
+\subsection*{#1}%
 }
 
 \newcommand{\nazwautworu}[1]{%
-\section*{\typosection{#1}}%
+\section*{#1}%
 }
 
 \newcommand{\podtytul}[1]{%
@@ -463,7 +461,9 @@ Letters={Uppercase}
 \newcommand{\translator}[1]{%
 \subsection*{\typosubsubsection{tłum. #1}}%
 }
-
+\newcommand{\translatorsline}[1]{%
+#1
+}
 
 \newcommand{\powiesc}[1]{#1}
 \newcommand{\opowiadanie}[1]{#1}
@@ -526,7 +526,7 @@ Letters={Uppercase}
 }
 \newcommand{\naglowekczesc}[1]{%
 \pagebreak
-\subsection*{\typosubsection{#1}}%
+\part{#1}%
 }
 \newcommand{\srodtytul}[1]{%
 \subsection*{\typosubsection{#1}}%
@@ -536,14 +536,14 @@ Letters={Uppercase}
 \subsubsection*{\typosubsubsection{#1}}%
 }
 \newcommand{\naglowekrozdzial}[1]{%
-\subsubsection*{\typosubsubsection{#1}}%
+\chapter{#1}%
 }
 
 \newcommand{\naglowekosoba}[1]{%
 \par{\textsc{#1}}\nopagebreak%
 }
 \newcommand{\naglowekpodrozdzial}[1]{%
-\par{#1}\nopagebreak%
+\section{#1}\nopagebreak%
 }
 
 \newcommand{\miejsceczas}[1]{%
index 9663bf5..39992dc 100644 (file)
         \def\authors{<xsl:call-template name="authors" />}
         \author{\authors}
         \title{<xsl:apply-templates select=".//dc:title" mode="inline" />}
+       \makeatletter
+       \let\theauthor\@author
+       \let\thetitle\@title
+       \makeatother
+
         \def\translatorsline{<xsl:call-template name="translators" />}
 
         \def\bookurl{<xsl:value-of select=".//dc:identifier.url" />}
 
 
 <xsl:template
-    match="naglowek_akt|naglowek_czesc|srodtytul|naglowek_osoba|naglowek_podrozdzial|naglowek_scena|naglowek_rozdzial|miejsce_czas|didaskalia|lista_osoba|akap|akap_dialog|akap_cd|motto_podpis|naglowek_listy">
+    match="naglowek_akt|naglowek_czesc|srodtytul|naglowek_osoba|naglowek_podrozdzial|naglowek_scena|autor_rozdzialu|naglowek_rozdzial|miejsce_czas|didaskalia|lista_osoba|akap|akap_dialog|akap_cd|motto_podpis|naglowek_listy|lista">
     <cmd>
         <xsl:attribute name="name">
             <xsl:value-of select="wl:texcommand(name())" />
 </xsl:template>
 
 
+<xsl:template match="link">
+  <cmd name="link">
+    <parm><xsl:value-of select="@url"/></parm>
+    <parm><xsl:apply-templates mode="inline"/></parm>
+  </cmd>
+</xsl:template>
+
+
 <xsl:template name="verse">
     <xsl:param name="verse-content" />
     <xsl:param name="verse-type" />
 <!-- ================================================ -->
 
 <xsl:template mode="inline"
-    match="pa|pe|pr|pt|mat|didask_tekst|slowo_obce|wyroznienie|osoba">
+    match="pa|pe|pr|pt|mat|didask_tekst|slowo_obce|wyroznienie|osoba|punkt|www">
     <cmd>
         <xsl:attribute name="name">
             <xsl:value-of select="wl:texcommand(name())" />
index d5154e1..4ed3d0e 100644 (file)
@@ -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
 %
@@ -17,7 +17,8 @@
 \RequirePackage{type1cm}
 \RequirePackage{amssymb}
 \RequirePackage{amsmath}
-
+\RequirePackage{paralist}
+\RequirePackage[normalem]{ulem}
 %\DeclareOption{13pt}{%
 %\AtEndOfClass{%
 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
       \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
 \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}
 \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}
+\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}
+%% 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
 
-\pagestyle{plain}
-\usepackage{fancyhdr}
-\usepackage[explicit]{titlesec}
 
-\makeatletter
+\renewcommand{\normalsize}{\fontsize{10.4}{14.28}\addfontfeature{LetterSpace=0.3}\selectfont}
+\setlength{\parindent}{4mm}
+\setlength{\parskip}{0mm}
 
+\renewcommand{\large}{\fontsize{14}{14.28}\selectfont} % srodtytul
+\renewcommand{\small}{\fontsize{8}{14.28}\selectfont} % paginy
+\renewcommand{\Large}{\fontsize{15}{21.42}\selectfont} % tytuł rozdziału
+\renewcommand{\huge}{\fontsize{18}{21.6}\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}
+\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
 \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}
+{}%
+{\thesubsection}{0pt}{\fakesc{#1}}
+
 
 \newcommand{\typosubsubsection}[1]{%
 {\textsc{#1}}
@@ -175,20 +227,23 @@ 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 %%%%%%%%
+\newlength{\footnoteindent}\newlength{\footnoteprespace}
+\setlength{\footnoteindent}{6mm}%{3.5mm}
+\setlength{\footnoteprespace}{.3em}
 \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{\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,222 +266,86 @@ 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}
-
-    \vspace{.6em}
-    \color{black}
-    }
-}
-
-\usepackage{printlen}
-
-\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}
+\newcommand{\makecover}{
 
-%% % Pusta strona 
-%% \clearpage
-%%         \thispagestyle{empty}
+  %\pdfpagewidth=#1
+  %\pdfpageheight=#2
 
-%% \vspace{2em}
-%%       \hspace{0mm}\parbox{16cm}{
-%% \centering
-%%       {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
-%%            Dzielenie się
-%%       }}
+  \thispagestyle{empty}
+  \newlength{\PictHOffset}
+  \newlength{\PictVOffset}
+  \setlength{\PictHOffset}{1in}
+  \addtolength{\PictHOffset}{\hoffset}
+  \addtolength{\PictHOffset}{\oddsidemargin}
 
-%%   \vspace{2em}
-%%          {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
-%%              Kultura i gospodarka epoki internetu
-%%          }}
-%% }
+  \setlength{\PictVOffset}{1in}
+  \addtolength{\PictVOffset}{\voffset}
+  \addtolength{\PictVOffset}{\topmargin}
+  \addtolength{\PictVOffset}{\headheight}
+  \addtolength{\PictVOffset}{\headsep}
+  \addtolength{\PictVOffset}{\topskip}
 
-%% \clearpage
-%%         \thispagestyle{empty}
+  \addtolength{\PictVOffset}{-\paperheight}
 
-%% \clearpage
-%%         \thispagestyle{empty}
+  \noindent\hspace*{-\PictHOffset}%
+  \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
+      \includegraphics[height=\paperheight,width=\paperwidth]{cover.jpg}}}
+  \newpage
+  %\vspace{\paperheight}
 
-%% %\parbox{10cm}{
-%% %  \centering
 
-%%   \hspace{-36mm}\parbox{16cm}{
-%% \centering
+  \thispagestyle{empty}
+  \begin{center}
+  \intro
+  {
+    \begin{spacing}{1.4}
+    \Huge \noindent \thetitle
+    \end{spacing}
+  }
+  \end{center}
 
-%%   {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
-%%       \noindent Philippe Aigrain
-%%   }}
-
-%%   {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
-%%       przy współpracy Suzanne Aigrain
-%%   }}
+  \vspace{2em}
   
-%%   \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/}
+  \begin{center}
+    \intro
+    {
+    \huge \noindent \theauthor
+    }
+  \end{center}
+                  %\emph{\thankyou}\\
+                  %\indent\emph{You made this book possible.}
+  \vspace{16em}
 
+  \begin{center}
+    \includegraphics[scale=.2]{logo.eps}
+  \end{center}
 
+  \newpage
+  \thispagestyle{empty}
 
-%% %\vspace{4em}
-%% %\box{\tableofcontents}
+  \input{editorial}
 
-%% %%   \begin{figure}[b!]
-%% %%   {
-%% %%     \footnotesize
-%% %%     \color{theme}
-%% %%     \noindent \rule{\linewidth}{0.4pt}
+  
+  }
 
-%% %%     \rightsinfo
-%% %% %    \vspace{.6em}
 
-%% %%     %Źródło: \href{\bookurl}{\bookurl}
 
-%% %%     %\vspace{.6em}
-%% %%     %\sourceinfo
+\renewcommand{\maketitle}{
+    {
+    \thispagestyle{empty}
+    \footnotesize
+    \color{theme}
+    \noindent \rule{\linewidth}{0.4pt}
 
-%% %%     %\description
-%% %%     %\vspace{.6em}
+    \vspace{.6em}
+    \color{black}
+    }
+}
 
-%% %%     Opublikowano przez \href{http://nowoczesnapolska.org.pl}{Fundację Nowoczesna Polska}, 2012.
 
-%% %%     \editors
+\newcommand{\editorialsection}{
 
-%% %%     %\vspace{.6em}
-%% %%     \coverby
-    
-%% %%     \color{black}
-%% %%   }
-%% %%   \end{figure}
-%% \clearpage
-%% }
 }
 
 
@@ -477,7 +396,11 @@ Mapping=tex-text
 \newcommand{\dramatwspolczesny}[1]{#1}
 
 \newcommand{\nota}[1]{%
-\par{#1}%
+\begin{em}%
+\begin{flushright}%
+#1%
+\end{flushright}%
+\end{em}%
 }
 
 \newcommand{\dedykacja}[1]{%
@@ -538,8 +461,15 @@ Mapping=tex-text
 \newcommand{\naglowekscena}[1]{%
 \subsubsection*{\typosubsubsection{#1}}%
 }
+
+\newcommand{\theautorrozdzialu}{}
+
+\newcommand{\autorrozdzialu}[1]{%
+\renewcommand{\theautorrozdzialu}{\newline\newline#1}
+}
+
 \newcommand{\naglowekrozdzial}[1]{%
-\chapter{#1}%
+\chapter{#1\theautorrozdzialu{}}\renewcommand{\theautorrozdzialu}{}%
 }
 
 \newcommand{\naglowekosoba}[1]{%
@@ -660,3 +590,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]{\url{#1}}
+
index b4559b4..87afc1e 100755 (executable)
@@ -24,7 +24,10 @@ class Book2Pdf(Book2Anything):
         Option('-R', '--resources', dest='resources', metavar='DIR',
                 help='a directory with additional resources'),
         Option('-D', '--documentclass', dest='documentclass', 
-               help='LaTeX document class, defaults to "wl"')
+               help='LaTeX document class, defaults to "wl"'),
+        Option('-s', '--customizations', dest='customizations', action='append', 
+               help='LaTeX document class options')
+
     ]