Fix XML entities left from MathML.
[librarian.git] / librarian / pdf / wl.cls
index 153f1a6..f8b7731 100644 (file)
 }%
 }%
 }
 }%
 }%
 }
+\DeclareOption{16pt}{%
+\AtEndOfClass{%
+% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
+\renewcommand\normalsize{%
+   \@setfontsize\normalsize{16pt}{18pt}%
+   \abovedisplayskip 15\p@ \@plus3\p@ \@minus7\p@
+   \abovedisplayshortskip \z@ \@plus3.5\p@
+   \belowdisplayshortskip 8\p@ \@plus4\p@ \@minus3\p@
+   \belowdisplayskip \abovedisplayskip
+   \let\@listi\@listI}\normalsize%
+\renewcommand\footnotesize{%
+   \@setfontsize\footnotesize\@xpt\@xiipt
+   \abovedisplayskip 12\p@ \@plus2\p@ \@minus5\p@
+   \abovedisplayshortskip \z@ \@plus3.5\p@
+   \belowdisplayshortskip 7\p@ \@plus3.5\p@ \@minus3\p@
+   \def\@listi{\leftmargin\leftmargini
+               \topsep 7\p@ \@plus2.5\p@ \@minus2.5\p@
+               \parsep 3.5\p@ \@plus2.5\p@ \@minus\p@
+               \itemsep \parsep}%
+   \belowdisplayskip \abovedisplayskip
+}%
+}%
+}
+
+\newif\iflargefont
+\largefontfalse
+
+\DeclareOption{26pt}{%
+\largefonttrue
+\AtEndOfClass{%
+% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
+\renewcommand\normalsize{%
+   \@setfontsize\normalsize{26pt}{31pt}%
+   \abovedisplayskip 14\p@ \@plus6\p@ \@minus14\p@
+   \abovedisplayshortskip \z@ \@plus6\p@
+   \belowdisplayshortskip 13\p@ \@plus7\p@ \@minus6\p@
+   \belowdisplayskip \abovedisplayskip
+   \let\@listi\@listI}\normalsize%
+   \setlength{\parindent}{1.5em}%
+\renewcommand\footnotesize{%
+   \@setfontsize\footnotesize{15pt}{20pt}
+   \abovedisplayskip 20\p@ \@plus4\p@ \@minus10\p@
+   \abovedisplayshortskip \z@ \@plus6\p@
+   \belowdisplayshortskip 12\p@ \@plus6\p@ \@minus6\p@
+   \def\@listi{\leftmargin\leftmargini
+               \topsep 12\p@ \@plus4\p@ \@minus4\p@
+               \parsep 6\p@ \@plus4\p@ \@minus\p@
+               \itemsep \parsep}%
+   \belowdisplayskip \abovedisplayskip
+}%
+\renewcommand\LARGE{\@setfontsize\LARGE{41pt}{50pt}}%
+\renewcommand\huge{\@setfontsize\huge{49pt}{60pt}}%
+}%
+}
+
+%  not supported on texlive version on jessie, and has weird side effects in some readers
+%% \XeTeXgenerateactualtext=1
 
 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
 
 
 %% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}}
 
 \newif\ifshowtoc \showtoctrue
 \DeclareOption{notoc}{\showtocfalse}
 
 \newif\ifshowtoc \showtoctrue
 \DeclareOption{notoc}{\showtocfalse}
 
+%\newif\ifsansfont \sansfontfalse
+%\DeclareOption{sansfont}{\sansfonttrue}
+
+\newif\ifmargins \marginstrue
+\DeclareOption{nomargins}{\marginsfalse}
+
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
 \ProcessOptions\relax
 \LoadClass[a4paper,oneside]{book}
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
 \ProcessOptions\relax
 \LoadClass[a4paper,oneside]{book}
 \usepackage{scalefnt}
 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
 
 \usepackage{scalefnt}
 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
 
+%\ifsansfont
+%\renewcommand{\familydefault}{\sfdefault}
+%\fi
+
 \newfontfamily\alien[
 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
 Numbers=OldStyle,
 \newfontfamily\alien[
 SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
 Numbers=OldStyle,
@@ -107,6 +174,28 @@ Scale=1.04,
 LetterSpace=-1.0
 ] {JunicodeWL}
 
 LetterSpace=-1.0
 ] {JunicodeWL}
 
+%\setmainfont [
+%UprightFont = NotoSerif-Regular,
+%ItalicFont = NotoSerif-Italic,
+%BoldFont = NotoSerif-Regular,
+%BoldItalicFont = NotoSerif-Italic,
+%SmallCapsFont = NotoSerif-Regular,
+%SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
+%Scale=1.04,
+%LetterSpace=-1.0
+%] {NotoSerif}
+
+%\setsansfont [
+%UprightFont = NotoSansDisplay-Regular,
+%ItalicFont = NotoSansDisplay-Italic,
+%BoldFont = NotoSansDisplay-Regular,
+%BoldItalicFont = NotoSansDisplay-Italic,
+%SmallCapsFont = NotoSansDisplay-Regular,
+%SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}},
+%Scale=1.04,
+%LetterSpace=-1.0
+%] {NotoSansDisplay}
+
 \defaultfontfeatures{
 SizeFeatures={
   {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
 \defaultfontfeatures{
 SizeFeatures={
   {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 },
@@ -146,6 +235,7 @@ Letters={SmallCaps,UppercaseSmallCaps}
 \usepackage{color}
 \definecolor{theme}{gray}{.3}
 
 \usepackage{color}
 \definecolor{theme}{gray}{.3}
 
+\ifmargins
 \setlength{\marginparsep}{2em}
 \setlength{\marginparwidth}{8.5em}
 \setlength{\oddsidemargin}{0pt}
 \setlength{\marginparsep}{2em}
 \setlength{\marginparwidth}{8.5em}
 \setlength{\oddsidemargin}{0pt}
@@ -154,6 +244,14 @@ Letters={SmallCaps,UppercaseSmallCaps}
 \setlength{\headheight}{0pt}
 \setlength{\headsep}{0pt}
 \setlength{\textheight}{24cm}
 \setlength{\headheight}{0pt}
 \setlength{\headsep}{0pt}
 \setlength{\textheight}{24cm}
+\else
+\addtolength{\oddsidemargin}{-.875in}
+\addtolength{\evensidemargin}{-.875in}
+\addtolength{\textwidth}{1.75in}
+
+\addtolength{\topmargin}{-.875in}
+\addtolength{\textheight}{1.5in}
+\fi
 
 \pagestyle{fancy}
 \fancyhf{}
 
 \pagestyle{fancy}
 \fancyhf{}
@@ -301,8 +399,7 @@ Letters={SmallCaps,UppercaseSmallCaps}
     Przekaż 1\% podatku na rozwój Wolnych Lektur:
     Fundacja Nowoczesna Polska, KRS 0000070056.
 
     Przekaż 1\% podatku na rozwój Wolnych Lektur:
     Fundacja Nowoczesna Polska, KRS 0000070056.
 
-    Pomóż uwolnić konkretną książkę, wspierając
-    \href{http://www.wolnelektury.pl/wesprzyj/}{zbiórkę na stronie wolnelektury.pl}.
+    Dołącz do \href{https://wolnelektury.pl/towarzystwo/}{Towarzystwa Przyjaciół Wolnych Lektur} i pomóż nam rozwijać bibliotekę.
 
     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}.
@@ -314,7 +411,11 @@ Letters={SmallCaps,UppercaseSmallCaps}
 
 
 \newcommand{\typosubsubsection}[1]{%
 
 
 \newcommand{\typosubsubsection}[1]{%
+\iflargefont
+{\textsc{\scalefont{2}#1}}
+\else
 {\textsc{#1}}
 {\textsc{#1}}
+\fi
 }
 
 \newcommand{\typosubsection}[1]{%
 }
 
 \newcommand{\typosubsection}[1]{%
@@ -322,15 +423,23 @@ Letters={SmallCaps,UppercaseSmallCaps}
 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 },
 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 }
+  {Size={12-}, FakeStretch=2.0, LetterSpace=8.0 }
 },
 Letters={Uppercase}
 }
 },
 Letters={Uppercase}
 }
-\MakeUppercase{#1}}
+\iflargefont
+\MakeUppercase{\scalefont{2}#1}
+\else
+\MakeUppercase{#1}
+\fi}
 }
 
 \newcommand{\typosection}[1]{%
 }
 
 \newcommand{\typosection}[1]{%
+\iflargefont
+{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{4}#1}}
+\else
 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
 {\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}}
+\fi
 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
 }
 
 %{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
 }
 
@@ -351,16 +460,23 @@ Letters={Uppercase}
 }
 
 \newcommand{\nazwapodutworu}[2]{%
 }
 
 \newcommand{\nazwapodutworu}[2]{%
-\vspace{10ex}%
+\vspace{5ex}%
 \section*{\typosection{#1}}%
 \addcontentsline{toc}{section}{#2}%
 }
 
 \section*{\typosection{#1}}%
 \addcontentsline{toc}{section}{#2}%
 }
 
+\newcommand{\nazwanadpodutworu}[2]{%
+\authortoc{}%
+\nazwapodutworu{#1}{#2}%
+\authortoc{}%
+}
+
 \newcommand{\autorutworu}[1]{%
 \subsection*{\typosubsection{#1}}%
 }
 
 \newcommand{\autorpodutworu}[1]{%
 \newcommand{\autorutworu}[1]{%
 \subsection*{\typosubsection{#1}}%
 }
 
 \newcommand{\autorpodutworu}[1]{%
+\vspace{5ex}%
 \subsection*{\typosubsection{#1}}%
 \authortoc{#1}%
 }
 \subsection*{\typosubsection{#1}}%
 \authortoc{#1}%
 }
@@ -370,7 +486,7 @@ Letters={Uppercase}
 }
 
 \newcommand{\nazwautworu}[1]{%
 }
 
 \newcommand{\nazwautworu}[1]{%
-\vspace{10ex}%
+\vspace{5ex}%
 \section*{\typosection{#1}}%
 }
 
 \section*{\typosection{#1}}%
 }
 
@@ -393,7 +509,7 @@ Letters={Uppercase}
 
 \newcommand{\nota}[1]{%
 \par{\raggedleft \emph{#1}}%
 
 \newcommand{\nota}[1]{%
 \par{\raggedleft \emph{#1}}%
-\vspace{10ex}%
+\vspace{5ex}%
 }
 
 \newcommand{\dedykacja}[1]{%
 }
 
 \newcommand{\dedykacja}[1]{%
@@ -412,8 +528,10 @@ Letters={Uppercase}
 \newlength{\fboxleftrule}
 \newlength{\fboxrightrule}
 
 \newlength{\fboxleftrule}
 \newlength{\fboxrightrule}
 
+\ifshowthemes
 \setlength{\fboxhsep}{5\fboxsep}
 \setlength{\fboxvsep}{20\fboxsep}
 \setlength{\fboxhsep}{5\fboxsep}
 \setlength{\fboxvsep}{20\fboxsep}
+\fi
 
 \setlength{\fboxtoprule}{\fboxrule}
 \setlength{\fboxleftrule}{\fboxrule}
 
 \setlength{\fboxtoprule}{\fboxrule}
 \setlength{\fboxleftrule}{\fboxrule}
@@ -512,14 +630,26 @@ Letters={Uppercase}
 \pagebreak
 \subsection*{\typosubsection{\huge #1}}%
 \addcontentsline{toc}{subsection}{#2}%
 \pagebreak
 \subsection*{\typosubsection{\huge #1}}%
 \addcontentsline{toc}{subsection}{#2}%
-\vspace{10ex}%
+\vspace{5ex}%
+}
+
+\newcommand{\podtytulakt}[1]{%
+\par{\typosubsubsection{\LARGE #1}}%
+\vspace{5ex}%
 }
 }
+
 \newcommand{\naglowekczesc}[2]{%
 \pagebreak
 \subsection*{\typosubsection{\huge #1}}%
 \addcontentsline{toc}{subsection}{#2}%
 \newcommand{\naglowekczesc}[2]{%
 \pagebreak
 \subsection*{\typosubsection{\huge #1}}%
 \addcontentsline{toc}{subsection}{#2}%
-\vspace{10ex}%
+\vspace{5ex}%
 }
 }
+
+\newcommand{\podtytulczesc}[1]{%
+\par{\typosubsubsection{\LARGE #1}}%
+\vspace{5ex}%
+}
+
 \newcommand{\srodtytul}[1]{%
 \subsection*{\typosubsection{#1}}%
 }
 \newcommand{\srodtytul}[1]{%
 \subsection*{\typosubsection{#1}}%
 }
@@ -529,12 +659,23 @@ Letters={Uppercase}
 \addcontentsline{toc}{subsubsection}{#2}%
 \vspace{5ex}%
 }
 \addcontentsline{toc}{subsubsection}{#2}%
 \vspace{5ex}%
 }
+
+\newcommand{\podtytulscena}[1]{%
+\par{\large #1}%
+\vspace{5ex}%
+}
+
 \newcommand{\naglowekrozdzial}[2]{%
 \subsubsection*{\typosubsubsection{\LARGE #1}}%
 \addcontentsline{toc}{subsubsection}{#2}%
 \vspace{5ex}%
 }
 
 \newcommand{\naglowekrozdzial}[2]{%
 \subsubsection*{\typosubsubsection{\LARGE #1}}%
 \addcontentsline{toc}{subsubsection}{#2}%
 \vspace{5ex}%
 }
 
+\newcommand{\podtytulrozdzial}[1]{%
+\par{\large #1}%
+\vspace{5ex}%
+}
+
 \newcommand{\naglowekosoba}[1]{%
 \medskip%
 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
 \newcommand{\naglowekosoba}[1]{%
 \medskip%
 \par{\textsc{\MakeLowercase{#1}}}\nopagebreak%
@@ -543,6 +684,10 @@ Letters={Uppercase}
 \vspace{5ex}\par{#1}\nopagebreak%
 }
 
 \vspace{5ex}\par{#1}\nopagebreak%
 }
 
+\newcommand{\podtytulpodrozdzial}[1]{%
+\par{#1}\nopagebreak%
+}
+
 \newcommand{\miejsceczas}[1]{%
 \par{\emph{#1}}%
 }
 \newcommand{\miejsceczas}[1]{%
 \par{\emph{#1}}%
 }