2 runs in creating pdf
[librarian.git] / librarian / pdf / fnprep.cls
index f290616..c413272 100644 (file)
@@ -13,8 +13,9 @@
 \RequirePackage{xifthen}
 \RequirePackage{environ} % environments with \BODY, for wyimek
 
 \RequirePackage{xifthen}
 \RequirePackage{environ} % environments with \BODY, for wyimek
 
-
+\PassOptionsToClass{landscape,twoside}{report}
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
+
 \ProcessOptions\relax
 \LoadClass{report}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \ProcessOptions\relax
 \LoadClass{report}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \usepackage{fancyhdr}
 \usepackage[MeX]{polski}
 
 \usepackage{fancyhdr}
 \usepackage[MeX]{polski}
 
+\usepackage{longtable}
+\usepackage{booktabs}
+\usepackage{colortbl}
+
 \usepackage{trace}
 \usepackage{caption}
 \usepackage{tabularx}
 \usepackage{trace}
 \usepackage{caption}
 \usepackage{tabularx}
@@ -42,6 +47,7 @@
 \usepackage{endnotes}
 \let\footnote=\endnote
 \newcommand{\printfootnotes}{%
 \usepackage{endnotes}
 \let\footnote=\endnote
 \newcommand{\printfootnotes}{%
+  \outmulticols
   \markboth{\MakeTextUppercase{Przypisy}}{}
   \renewcommand{\enoteheading}{}
   \begingroup
   \markboth{\MakeTextUppercase{Przypisy}}{}
   \renewcommand{\enoteheading}{}
   \begingroup
@@ -171,6 +177,11 @@ Mapping=tex-text
 %% \renewcommand{\footnotesize}{\addfontfeature{LetterSpace=1.0}\fontsize{9}{10.74}\selectfont}
 
 
 %% \renewcommand{\footnotesize}{\addfontfeature{LetterSpace=1.0}\fontsize{9}{10.74}\selectfont}
 
 
+% • • • • • • • • Multicols  •
+\newif\ifinmulticols \inmulticolsfalse
+
+\newcommand{\inmulticols}[0]{\ifinmulticols{}\else\begin{multicols*}{3}\inmulticolstrue\fi}
+\newcommand{\outmulticols}[0]{\ifinmulticols{}\end{multicols*}\clearpage\inmulticolsfalse\else\fi}
 
 % • • • • • • • • • COLORS • •
 \definecolor{stoK}{cmyk}{0,0,0,1}
 
 % • • • • • • • • • COLORS • •
 \definecolor{stoK}{cmyk}{0,0,0,1}
@@ -179,6 +190,8 @@ Mapping=tex-text
 \definecolor{graybg}{cmyk}{0,0,0,0.55}
 %\color{stoK}
 
 \definecolor{graybg}{cmyk}{0,0,0,0.55}
 %\color{stoK}
 
+\arrayrulecolor{headcolor}
+
 % • • • • • • • • METADATA • •
 
 \makeatletter
 % • • • • • • • • METADATA • •
 
 \makeatletter
@@ -238,7 +251,7 @@ Mapping=tex-text
 \makeatother
 
 \nochapternumbers
 \makeatother
 
 \nochapternumbers
-\startcontents[chapter]
+%\startcontents[chapter] % ??? XXX
 
 \newcommand{\chapterblock}[1]{%
 \clearpage%
 
 \newcommand{\chapterblock}[1]{%
 \clearpage%
@@ -250,7 +263,7 @@ Mapping=tex-text
 \begin{minipage}[t][\dimexpr\textheight-28pt\relax]{\dimexpr\szpaltawidth-5mm\relax}%
 \Huge{}\headfont\color{white}#1%
 \vspace{\dimexpr21mm-11mm\relax}%
 \begin{minipage}[t][\dimexpr\textheight-28pt\relax]{\dimexpr\szpaltawidth-5mm\relax}%
 \Huge{}\headfont\color{white}#1%
 \vspace{\dimexpr21mm-11mm\relax}%
-\par{\printcontents[chapter]{}{1}{}}
+\par{\color{white}\printcontents[chapter]{}{1}{}}
 \end{minipage}%(testing)%\rule{0.1pt}{\baselineskip}%
 \hspace{2.5mm}}%
 \vspace{\dimexpr-\parskip-11pt\relax}%
 \end{minipage}%(testing)%\rule{0.1pt}{\baselineskip}%
 \hspace{2.5mm}}%
 \vspace{\dimexpr-\parskip-11pt\relax}%
@@ -427,33 +440,33 @@ Mapping=tex-text
 
   %% \paperheight=210mm
 
 
   %% \paperheight=210mm
 
-  \newgeometry{paperwidth=297mm,paperheight=210mm}
-  \pdfpageheight=210mm
-  \pdfpagewidth=297mm
+  %% \newgeometry{paperwidth=297mm,paperheight=210mm}
+  %% \pdfpageheight=210mm
+  %% \pdfpagewidth=297mm
 
 
-  \thispagestyle{empty}
-  \newlength{\PictHOffset}
-  \newlength{\PictVOffset}
-  \setlength{\PictHOffset}{1in}
-  \addtolength{\PictHOffset}{\hoffset}
-  \addtolength{\PictHOffset}{\oddsidemargin}
+  %% \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}
+  %% \setlength{\PictVOffset}{1in}
+  %% \addtolength{\PictVOffset}{\voffset}
+  %% \addtolength{\PictVOffset}{\topmargin}
+  %% \addtolength{\PictVOffset}{\headheight}
+  %% \addtolength{\PictVOffset}{\headsep}
+  %% \addtolength{\PictVOffset}{\topskip}
 
 
-  \addtolength{\PictVOffset}{-\paperheight}
+  %% \addtolength{\PictVOffset}{-\paperheight}
 
 
-  \noindent\hspace*{-\PictHOffset}%
-  \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
-      \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.pdf}}}
+  %% \noindent\hspace*{-\PictHOffset}%
+  %% \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
+  %%     \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.pdf}}}
 
 
-  \restoregeometry
-  \pdfpageheight=210mm
-  \pdfpagewidth=148mm
+  %% \restoregeometry
+  %% \pdfpageheight=210mm
+  %% \pdfpagewidth=148mm
 
   }
 
 
   }
 
@@ -461,53 +474,51 @@ Mapping=tex-text
   %\vspace{\paperheight}
   \thispagestyle{empty}
   \cleardoublepage
   %\vspace{\paperheight}
   \thispagestyle{empty}
   \cleardoublepage
-  \setcounter{page}{1}
-  \thispagestyle{empty}
-  \begin{center}
-  \intro
-  {
-    \begin{spacing}{1.4}
-    \Huge \noindent \thetitle
-    \end{spacing}
-  }
-  \end{center}
+  %% \setcounter{page}{1}
+  %% \thispagestyle{empty}
+  %% \begin{center}
+  %% {
+  %%   \begin{spacing}{1.4}
+  %%   \Huge \noindent \thetitle
+  %%   \end{spacing}
+  %% }
+  %% \end{center}
 
 
-  \vspace{\baselineskip}
+  %% \vspace{\baselineskip}
 
 
-  \begin{center}
-    \intro
-    {
-      \huge \noindent
-      \theauthor
+  %% \begin{center}
+  %%   \intro
+  %%   {
+  %%     \huge \noindent
+  %%     \theauthor
 
 
-    }
-  \end{center}
-                  %\emph{\thankyou}\\
-                  %\indent\emph{You made this book possible.}
-  \vspace{7\baselineskip}
+  %%   }
+  %% \end{center}
+  %%                 %\emph{\thankyou}\\
+  %%                 %\indent\emph{You made this book possible.}
+  %% \vspace{7\baselineskip}
 
 
-  \begin{center}
-    \includegraphics[scale=.2]{logo.eps}
-  \end{center}
+  %% \begin{center}
+  %%   \includegraphics[scale=.2]{logo.eps}
+  %% \end{center}
 
 }
 
 
 \newcommand{\editorialsection}{
   \clearpage
 
 }
 
 
 \newcommand{\editorialsection}{
   \clearpage
-  \thispagestyle{empty}
-  {
-    \setlength{\parindent}{0mm}
-    \small
-  \input{editorial}
-  }
+  %% \thispagestyle{empty}
+  %% {
+  %%   \setlength{\parindent}{0mm}
+  %%   \small
+  %% \input{editorial}
+  %% }
 }
 
 \renewcommand*\contentsname{Spis treści}
 \newcommand{\spistresci}{
 {
 }
 
 \renewcommand*\contentsname{Spis treści}
 \newcommand{\spistresci}{
 {
-  \intro
-  \setcounter{tocdepth}{0}
+%  \setcounter{tocdepth}{0}
   \tableofcontents
   \newpage
 }
   \tableofcontents
   \newpage
 }
@@ -630,6 +641,7 @@ Mapping=tex-text
 
 
 \newcommand{\naglowekrozdzial}[1]{%
 
 
 \newcommand{\naglowekrozdzial}[1]{%
+\inmulticols%
 \startcontents[chapter]
 \markboth{#1}{}
 %
 \startcontents[chapter]
 \markboth{#1}{}
 %
@@ -640,6 +652,7 @@ Mapping=tex-text
 \par{\textsc{#1}}\nopagebreak%
 }
 \newcommand{\naglowekpodrozdzial}[1]{%
 \par{\textsc{#1}}\nopagebreak%
 }
 \newcommand{\naglowekpodrozdzial}[1]{%
+\inmulticols%
 \section{#1}\nopagebreak%
 }
 \newcommand{\miejsceczas}[1]{%
 \section{#1}\nopagebreak%
 }
 \newcommand{\miejsceczas}[1]{%
@@ -650,6 +663,7 @@ Mapping=tex-text
 }
 
 \newcommand{\akap}[1]{%
 }
 
 \newcommand{\akap}[1]{%
+\inmulticols%
 #1
 
 % newline here needed, we don't use \par cause it ignores \noindent before
 #1
 
 % newline here needed, we don't use \par cause it ignores \noindent before
@@ -685,6 +699,11 @@ Mapping=tex-text
 \hspace*{#1}#2%
 }
 
 \hspace*{#1}#2%
 }
 
+\newcommand{\pa}[1]{\NoCaseChange{\endnote{#1}}}
+\newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}}
+\newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}}
+\newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}}
+
 
 \newcommand{\mat}[1]{$#1$}
 
 
 \newcommand{\mat}[1]{$#1$}
 
@@ -757,8 +776,8 @@ Mapping=tex-text
 
 
 \newcommand{\lista}[1]{%
 
 
 \newcommand{\lista}[1]{%
+\inmulticols%
 \begin{compactenum}
 \begin{compactenum}
-%\setlength{\parskip}{\parindent}
 #1
 \end{compactenum}
 }
 #1
 \end{compactenum}
 }
@@ -769,3 +788,37 @@ Mapping=tex-text
 \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
 
 \newcommand{\www}[1]{{\normalfont\href{#1}{#1}}}
 \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
 
 \newcommand{\www}[1]{{\normalfont\href{#1}{#1}}}
+
+
+
+% TABELA %
+
+\newenvironment{tabela}[0]%
+{\renewcommand{\inmulticols}{\relax}%
+\begin{longtable}{p{40mm}@{\hspace{5mm}}p{65mm}@{\hspace{5mm}}p{65mm}@{\hspace{5mm}}p{65mm}}}%
+{\end{longtable}}
+
+\newcommand{\formatkomnaglowek}[1]% reset format
+             {{\LARGE\headfont\color{headcolor}\MakeTextUppercase{#1}}}
+\newcommand{\formatkompierwsza}[1]% reset format
+             {{\LARGE\headfont\color{graybg}\MakeTextUppercase{#1}}}
+\newcommand{\formatkom}[1]{\scriptsize{}#1} % nop
+
+\newcommand{\tabelanaglowek}[1]{%
+    #1
+    \\[4mm]
+    \endhead
+}
+
+\newcommand{\tabelawiersz}[1]{
+    \cmidrule[0.7pt](r{5mm}){1-1}%
+    \cmidrule[0.7pt](r{5mm}){2-2}%
+    \cmidrule[0.7pt](r{5mm}){3-3}%
+    \cmidrule[0.7pt](r{5mm}){4-4} \\[1mm]
+#1
+    \\[4mm]
+}
+
+\newcommand{\tabelakomnaglowek}[1]{\formatkomnaglowek{#1}}
+\newcommand{\tabelakompierwsza}[1]{\formatkompierwsza{#1}}
+\newcommand{\tabelakom}[1]{\formatkom{#1}}