% -*- 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
%
\RequirePackage{type1cm}
\RequirePackage{amssymb}
\RequirePackage{amsmath}
+\RequirePackage{paralist}
+\RequirePackage[normalem]{ulem}
+\RequirePackage{xifthen}
+\RequirePackage{environ} % environments with \BODY, for wyimek
%\DeclareOption{13pt}{%
%\AtEndOfClass{%
\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{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
-
+%\usepackage{trimspaces} % imported by something else?
+\usepackage{color}
\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{fancyhdr}
+
+%\usepackage{fnpos}
+\usepackage{printlen}
+\usepackage{calc}
+\usepackage[stable]{footmisc}
+
+\usepackage{chngcntr}
+\counterwithout{footnote}{chapter}
+
+\usepackage[explicit]{titlesec}
+%% Wyimki - placing them on correct pages
+\usepackage{changepage}
+%\usepackage{fltpage}
+%\usepackage{float}
-\setmainfont [
+\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[
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=3.0}\selectfont}
+\renewcommand{\large}{\fontsize{14}{14.28}\addfontfeature{LetterSpace=3.0}\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}
+%\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#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}}
}
%%%%%%%%%%%%%%%%%% ^^
-%%%%% 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
+%% }
+
+% make public
+\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
\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}}}}
-\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}
-
-%% % 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}
+\newcommand{\makecover}{
+ %% \paperwidth=297mm
-%% \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}.
+ %% \paperheight=210mm
-%% \vspace{1em}
+ \newgeometry{paperwidth=297mm,paperheight=210mm}
+ \pdfpageheight=210mm
+ \pdfpagewidth=297mm
-%% \noindent \includegraphics[scale=.4]{cce_trust.eps}
+ \thispagestyle{empty}
+ \newlength{\PictHOffset}
+ \newlength{\PictVOffset}
+ \setlength{\PictHOffset}{1in}
+ \addtolength{\PictHOffset}{\hoffset}
+ \addtolength{\PictHOffset}{\oddsidemargin}
-%% \vspace{1em}
+ \setlength{\PictVOffset}{1in}
+ \addtolength{\PictVOffset}{\voffset}
+ \addtolength{\PictVOffset}{\topmargin}
+ \addtolength{\PictVOffset}{\headheight}
+ \addtolength{\PictVOffset}{\headsep}
+ \addtolength{\PictVOffset}{\topskip}
-%% \noindent Wydawca: Fundacja Nowoczesna Polska, Warszawa 2012
+ \addtolength{\PictVOffset}{-\paperheight}
-%% \vspace{1em}
-%% \includegraphics[scale=.2]{logo.eps}
-%% \vspace{1em}
+ \noindent\hspace*{-\PictHOffset}%
+ \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
+ \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.pdf}}}
-%% \noindent \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
+ \restoregeometry
+ \pdfpageheight=210mm
+ \pdfpagewidth=148mm
+ }
+\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
-%% %\vspace{4em}
-%% %\box{\tableofcontents}
-
-%% %% \begin{figure}[b!]
-%% %% {
-%% %% \footnotesize
-%% %% \color{theme}
-%% %% \noindent \rule{\linewidth}{0.4pt}
-
-%% %% \rightsinfo
-%% %% % \vspace{.6em}
-
-%% %% %Ź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{\dramatwspolczesny}[1]{#1}
\newcommand{\nota}[1]{%
-\par{#1}%
+\begin{em}%
+\begin{flushleft}%
+\noindent #1%
+\end{flushleft}%
+\end{em}%
}
\newcommand{\dedykacja}[1]{%
\part{#1}%
}
\newcommand{\srodtytul}[1]{%
-\subsection*{\typosubsection{#1}}%
+\subsection{#1}%
}
\newcommand{\naglowekscena}[1]{%
\subsubsection*{\typosubsubsection{#1}}%
}
+
+\newcommand{\theautorrozdzialu}{}
+
+\newcommand{\autorrozdzialu}[1]{%
+\renewcommand{\theautorrozdzialu}{{\normalfont\normalsize\newline{}\newline{}\emph{#1}}}
+}
+
+
\newcommand{\naglowekrozdzial}[1]{%
-\chapter{#1}%
+\chapter[#1]{\MakeUppercase{#1}\theautorrozdzialu{}}
+\renewcommand{\theautorrozdzialu}{}%
}
\newcommand{\naglowekosoba}[1]{%
}
\newcommand{\sekcjaswiatlo}{%
-\vspace{30pt}%
+\vspace{\baselineskip}%
}
\newcommand{\sekcjaasterysk}{%
\vspace{10pt}%
}
+\newcommand{\ilustrscale}[0]{1}
+\newcommand{\setilustrscale}[1]{\renewcomand{\ilustrscale}{#1}}
+
+\newcommand{\ilustr}[3][]{
+ \vspace{2\baselineskip}%
+ \begin{center}%
+ \ifthenelse{\isempty{#1}}%
+ {\par{\includegraphics{\trimspace{#2}}\\#3}}%
+ {\par{\includegraphics[#1]{\trimspace{#2}}\\#3}}%
+ \end{center}%
+ \vspace{2\baselineskip}%
+}
+
+
\newcommand{\motyw}[2][0]{%
\ifshowthemes
\mbox{}%
\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}}}