prawie koniec
[librarian.git] / librarian / pdf / wlpub.cls
index d5154e1..37965a9 100644 (file)
@@ -1,6 +1,6 @@
 % -*- coding: utf-8 -*-
 \NeedsTeXFormat{LaTeX2e}
 % -*- 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
 %
 
 % PDF customizations
 %
 \RequirePackage{type1cm}
 \RequirePackage{amssymb}
 \RequirePackage{amsmath}
 \RequirePackage{type1cm}
 \RequirePackage{amssymb}
 \RequirePackage{amsmath}
+\RequirePackage{paralist}
+\RequirePackage[normalem]{ulem}
+\RequirePackage{xifthen}
+\RequirePackage{environ} % environments with \BODY, for wyimek
 
 %\DeclareOption{13pt}{%
 %\AtEndOfClass{%
 
 %\DeclareOption{13pt}{%
 %\AtEndOfClass{%
       \setlength{\paperheight}{210mm}%
       \setlength{\paperwidth}{148mm}}
 % a5paper dropped down size
       \setlength{\paperheight}{210mm}%
       \setlength{\paperwidth}{148mm}}
 % a5paper dropped down size
-\newif\ifafivepaper \afivepaperfalse
+\newif\ifcutafivepaper \cutafivepaperfalse
 \DeclareOption{a5paperdd}{%
   \setlength{\paperheight}{225mm}%
   \setlength{\paperwidth}{160mm}%
 \DeclareOption{a5paperdd}{%
   \setlength{\paperheight}{225mm}%
   \setlength{\paperwidth}{160mm}%
-  \afivepapertrue
+  \cutafivepapertrue
 }
 
 \newif\ifshowfootnotes \showfootnotestrue
 }
 
 \newif\ifshowfootnotes \showfootnotestrue
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{extbook}}
 \ProcessOptions\relax
 \LoadClass{extbook}
 \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{trace}
 \usepackage{caption}
 \usepackage[MeX]{polski}
 \usepackage{icomma}
 \usepackage[xetex]{graphicx}
 \usepackage[MeX]{polski}
 \usepackage{icomma}
 \usepackage[xetex]{graphicx}
-\usepackage{fontspec}
+\usepackage[silent]{fontspec} % silent - no warnings, quiet - warn only to log
 \usepackage{xunicode}
 \usepackage{xltxtra}
 \usepackage{xunicode}
 \usepackage{xltxtra}
-\usepackage{trimspaces}
-
+%\usepackage{trimspaces} % imported by something else?
+\usepackage{color}
 \usepackage[overload]{textcase}
 \usepackage{scalefnt}
 \usepackage[overload]{textcase}
 \usepackage{scalefnt}
-\usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
+\usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex,linktocpage]{hyperref}
+%\usepackage{hyperref}
+\usepackage{fancyhdr}
+
+%\usepackage{fnpos}
+\usepackage{printlen}
+\usepackage{calc}
+\usepackage[stable]{footmisc}
+
+\usepackage{chngcntr}
+\counterwithout{footnote}{chapter}
+
+\usepackage[explicit]{titlesec}
+\usepackage{microtype}
+
+%% Wyimki - placing them on correct pages
+\usepackage[strict]{changepage}
+%\usepackage{fltpage}
+%\usepackage{float}
+
+\pagestyle{plain}
+% bottom figure below footnotes
+%\makeFNabove
+
+%%% Hyphenation opts:
+%\pretolerance=10000
+\tolerance=2600
+\emergencystretch=30pt
+
+
+%%%%%%%%%%%%%%%%%%%%%%% 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},
 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}
 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
 \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=3.0}\selectfont}
+\renewcommand{\large}{\fontsize{14}{14.28}\addfontfeature{LetterSpace=3.0,Letters=Uppercase}\selectfont} % srodtytul
+\renewcommand{\small}{\fontsize{8}{14.28}\addfontfeature{LetterSpace=5.0}\selectfont} % paginy
+\renewcommand{\Large}{\fontsize{15}{21.42}\addfontfeature{LetterSpace=0.0}\selectfont} % tytuł rozdziału
+\renewcommand{\huge}{\fontsize{18}{28.56}\addfontfeature{LetterSpace=1.0}\selectfont} % wyimek
+\renewcommand{\Huge}{\fontsize{24}{40}\selectfont} % cover
+\renewcommand{\footnotesize}{\addfontfeature{LetterSpace=1.0}\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}
 \definecolor{theme}{gray}{.3}
+%\color{stoK}
 
 
 %%%%%%%%%%%%%%%%%%%%%% Headings.
 
 
 %%%%%%%%%%%%%%%%%%%%%% Headings.
-
 \pagestyle{fancy}
 \fancyhf{}
 \renewcommand{\headrulewidth}{0pt}
 \renewcommand{\footrulewidth}{0pt}
 \pagestyle{fancy}
 \fancyhf{}
 \renewcommand{\headrulewidth}{0pt}
 \renewcommand{\footrulewidth}{0pt}
-
-%\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
+\makeatletter
+%%%%%%%%%% Nagłówek normalny
 \cfoot{}
 \cfoot{}
-%\rfoot{{\footnotesize \thepage}}
-\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}
-\fancyhead[CE]{{\textsc{\MakeUppercase{\@title}}}}
-\fancyhead[CO]{{\textsc{\leftmark}}}
-\fancyhead[LE,RO]{{\thepage}}
+% this will go to \leftmark
+\renewcommand{\chaptermark}[1]{\markboth{\MakeTextUppercase{#1}}{}}
+\fancyhead[CE]{{\small\MakeTextUppercase{\@author, \@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.
 
 %%%%%%%%%%%%%%%%%%%%%% 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#1}}
+\newlength{\chapterposcorrection}\newlength{\chapterspaceafter}
+\setlength{\chapterposcorrection}{-\headsep-2\baselineskip-2.352mm} % 2.352 is a measured correction:
+\setlength{\chapterspaceafter}{14\baselineskip-14pt+2.352mm}%\f@size of large
+\titlespacing*{\chapter}{0pt}{\chapterposcorrection}{\chapterspaceafter}
 
 
-%% Subsections
+%% Sections
 \titleformat{\section}%
 \titleformat{\section}%
-{\bf\large\addfontfeature{Scale=1.0}}%
-{\thesection\enskip}{0pt}{#1}
+{\addfontfeature{LetterSpace=0.3}\large}%
+{\thesection{}.}{.5em}{\MakeTextUppercase{#1}}
+
 \renewcommand{\thesection}{\Roman{section}}
 
 \renewcommand{\thesection}{\Roman{section}}
 
-\titleformat{\subsection}%
-{\sc}%
-{\thesubsection}{0pt}{#1}
+\titleformat{\subsection}[runin]%
+{}%
+{\thesubsection{}.}{.5em}{\MakeTextUppercase{#1}.}[]
+
+\renewcommand{\thesubsection}{\Alph{subsection}}
+\titlespacing*{\subsection}{0pt}{\baselineskip}{.5em}
 
 \newcommand{\typosubsubsection}[1]{%
 {\textsc{#1}}
 
 \newcommand{\typosubsubsection}[1]{%
 {\textsc{#1}}
@@ -166,7 +241,7 @@ Mapping=tex-text
 
 %% XXX delete them
 \newcommand{\typosubsection}[1]{%
 
 %% XXX delete them
 \newcommand{\typosubsection}[1]{%
-{\MakeUppercase{#1}}
+{\MakeTextUppercase{#1}}
 }
 
 \newcommand{\typosection}[1]{%
 }
 
 \newcommand{\typosection}[1]{%
@@ -175,262 +250,173 @@ 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}{8mm}%{3.5mm}
+\setlength{\footnoteprespace}{0em}
 \makeatletter
 
 \renewcommand\@makefnmark{%
 \makeatletter
 
 \renewcommand\@makefnmark{%
-\hbox{{\normalfont\@thefnmark}}%
+\hspace{\footnoteprespace}
+\hbox{{\normalfont \@thefnmark}}%
 }
 \renewcommand\thefootnote{[\arabic{footnote}]}
 
 }
 \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
+%% }
 
 
+% make public
 \def\trimspace#1{\trim@spaces{#1}}
 
 \makeatother
 
 \def\trimspace#1{\trim@spaces{#1}}
 
 \makeatother
 
+%%%%%%%%%%%%%%%%%%%%%% Wyimki
+%% \floatstyle{plain}
+%% \newfloat{wyimekbox}{p}{wmk}
+%% \floatname{wyimekbox}{Wyimek}
+
+\NewEnviron{wyimek}{%
+  \checkoddpage
+  \ifoddpage
+    \PackageWarning{wlpub}{Wyimek on odd page, omitting it.}
+  \else
+    \begin{figure}[tp]
+      \begin{center}
+        \begin{minipage}[t][\textheight][c]{70mm}
+          \huge\it\BODY
+        \end{minipage}
+      \end{center}
+    \end{figure}
+  \fi
+  \BODY
+}
+
+
+
 
 
-\clubpenalty=100000
-\widowpenalty=100000
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\clubpenalty=400
+\widowpenalty=400
 
 
 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
 \newsavebox{\ximagebox}\newlength{\ximageheight}
 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
 \newcommand{\xbox}[1]
 
 
 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
 \newsavebox{\ximagebox}\newlength{\ximageheight}
 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
 \newcommand{\xbox}[1]
-{\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}%
+{\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximapgebox}}%
 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
 \usebox{\ximagebox}%
 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
 
 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
 \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}
-}
 
 
+\newcommand{\makecover}{
+  %% \paperwidth=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}
-
-%% % 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
-%%          }}
-%% }
-
-%% \clearpage
-%%         \thispagestyle{empty}
-
-%% \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
-%%   }}
-  
-%%   \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}
+  %% \paperheight=210mm
 
 
-%% \noindent \includegraphics[scale=.4]{cce_trust.eps}
+  \newgeometry{paperwidth=297mm,paperheight=210mm}
+  \pdfpageheight=210mm
+  \pdfpagewidth=297mm
 
 
-%% \vspace{1em}
+  \thispagestyle{empty}
+  \newlength{\PictHOffset}
+  \newlength{\PictVOffset}
+  \setlength{\PictHOffset}{1in}
+  \addtolength{\PictHOffset}{\hoffset}
+  \addtolength{\PictHOffset}{\oddsidemargin}
 
 
-%% \noindent Wydawca: Fundacja Nowoczesna Polska, Warszawa 2012
+  \setlength{\PictVOffset}{1in}
+  \addtolength{\PictVOffset}{\voffset}
+  \addtolength{\PictVOffset}{\topmargin}
+  \addtolength{\PictVOffset}{\headheight}
+  \addtolength{\PictVOffset}{\headsep}
+  \addtolength{\PictVOffset}{\topskip}
 
 
-%% \vspace{1em}
-%% \includegraphics[scale=.2]{logo.eps}
-%% \vspace{1em}
+  \addtolength{\PictVOffset}{-\paperheight}
 
 
-%% \noindent \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
+  \noindent\hspace*{-\PictHOffset}%
+  \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
+      \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.pdf}}}
 
 
+  \restoregeometry
+  \pdfpageheight=210mm
+  \pdfpagewidth=148mm
 
 
+  }
 
 
-%% %\vspace{4em}
-%% %\box{\tableofcontents}
-
-%% %%   \begin{figure}[b!]
-%% %%   {
-%% %%     \footnotesize
-%% %%     \color{theme}
-%% %%     \noindent \rule{\linewidth}{0.4pt}
-
-%% %%     \rightsinfo
-%% %% %    \vspace{.6em}
+\renewcommand{\maketitle}{
+  %\vspace{\paperheight}
+  \thispagestyle{empty}
+  \cleardoublepage
+  \setcounter{page}{1}
+  \thispagestyle{empty}
+  \begin{center}
+  \intro
+  {
+    \begin{spacing}{1.4}
+    \Huge \noindent \thetitle
+    \end{spacing}
+  }
+  \end{center}
+
+  \vspace{\baselineskip}
+
+  \begin{center}
+    \intro
+    {
+      \huge \noindent
+      \theauthor
 
 
-%% %%     %Źródło: \href{\bookurl}{\bookurl}
+    }
+  \end{center}
+                  %\emph{\thankyou}\\
+                  %\indent\emph{You made this book possible.}
+  \vspace{7\baselineskip}
 
 
-%% %%     %\vspace{.6em}
-%% %%     %\sourceinfo
+  \begin{center}
+    \includegraphics[scale=.2]{logo.eps}
+  \end{center}
 
 
-%% %%     %\description
-%% %%     %\vspace{.6em}
+}
 
 
-%% %%     Opublikowano przez \href{http://nowoczesnapolska.org.pl}{Fundację Nowoczesna Polska}, 2012.
 
 
-%% %%     \editors
+\newcommand{\editorialsection}{
+  \clearpage
+  \thispagestyle{empty}
+  {
+    \setlength{\parindent}{0mm}
+  \input{editorial}
+  }
+}
 
 
-%% %%     %\vspace{.6em}
-%% %%     \coverby
-    
-%% %%     \color{black}
-%% %%   }
-%% %%   \end{figure}
-%% \clearpage
-%% }
+\renewcommand*\contentsname{Spis treści}
+\newcommand{\spistresci}{
+{
+  \intro
+  \setcounter{tocdepth}{0}
+  \tableofcontents
+  \newpage
+}
 }
 
 
 
 }
 
 
 
+
 \newcommand{\tytul}[1]{%
 #1%
 \vspace{1em}%
 \newcommand{\tytul}[1]{%
 #1%
 \vspace{1em}%
@@ -477,7 +463,11 @@ Mapping=tex-text
 \newcommand{\dramatwspolczesny}[1]{#1}
 
 \newcommand{\nota}[1]{%
 \newcommand{\dramatwspolczesny}[1]{#1}
 
 \newcommand{\nota}[1]{%
-\par{#1}%
+\begin{em}%
+\begin{flushleft}%
+\noindent #1%
+\end{flushleft}%
+\end{em}%
 }
 
 \newcommand{\dedykacja}[1]{%
 }
 
 \newcommand{\dedykacja}[1]{%
@@ -490,7 +480,7 @@ Mapping=tex-text
 
 \newcommand{\dlugicytat}[1]{%
 \begin{quotation}%
 
 \newcommand{\dlugicytat}[1]{%
 \begin{quotation}%
-#1%
+\noindent{}\ignorespaces#1%
 \end{quotation}%
 }
 
 \end{quotation}%
 }
 
@@ -532,14 +522,23 @@ Mapping=tex-text
 \part{#1}%
 }
 \newcommand{\srodtytul}[1]{%
 \part{#1}%
 }
 \newcommand{\srodtytul}[1]{%
-\subsection*{\typosubsection{#1}}%
+\subsection{#1}%
 }
 
 \newcommand{\naglowekscena}[1]{%
 \subsubsection*{\typosubsubsection{#1}}%
 }
 }
 
 \newcommand{\naglowekscena}[1]{%
 \subsubsection*{\typosubsubsection{#1}}%
 }
+
+\newcommand{\theautorrozdzialu}{}
+
+\newcommand{\autorrozdzialu}[1]{%
+\renewcommand{\theautorrozdzialu}{{\normalfont\normalsize\newline{}\newline{}\parbox{\textwidth}{\normalsize\it #1}}}
+}
+
+
 \newcommand{\naglowekrozdzial}[1]{%
 \newcommand{\naglowekrozdzial}[1]{%
-\chapter{#1}%
+\chapter[#1]{\MakeUppercase{#1}\theautorrozdzialu{}}
+\renewcommand{\theautorrozdzialu}{}%
 }
 
 \newcommand{\naglowekosoba}[1]{%
 }
 
 \newcommand{\naglowekosoba}[1]{%
@@ -557,7 +556,9 @@ Mapping=tex-text
 }
 
 \newcommand{\akap}[1]{%
 }
 
 \newcommand{\akap}[1]{%
-\par{#1}%
+#1
+
+% newline here needed, we don't use \par cause it ignores \noindent before
 }
 \newcommand{\akapdialog}[1]{%
 \par{#1}%
 }
 \newcommand{\akapdialog}[1]{%
 \par{#1}%
@@ -622,7 +623,7 @@ Mapping=tex-text
 }
 
 \newcommand{\sekcjaswiatlo}{%
 }
 
 \newcommand{\sekcjaswiatlo}{%
-\vspace{30pt}%
+\vspace{\baselineskip}%
 }
 
 \newcommand{\sekcjaasterysk}{%
 }
 
 \newcommand{\sekcjaasterysk}{%
@@ -638,12 +639,17 @@ Mapping=tex-text
 \vspace{10pt}%
 }
 
 \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}%
   \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}%
   \end{center}%
-  \vspace{1em}%
+  \vspace{2\baselineskip}%
 }
 
 
 }
 
 
@@ -660,3 +666,16 @@ Mapping=tex-text
 \fi
 }
 
 \fi
 }
 
+\newcommand{\lista}[1]{%
+\begin{compactitem}
+\setlength{\parskip}{\parindent}
+#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}}}