1 % -*- coding: utf-8 -*-
2 \NeedsTeXFormat{LaTeX2e}
3 \ProvidesClass{fnprep}[2011/11/28 Modern Poland Foundation Report style]
6 %\RequirePackage{geometry}
7 \RequirePackage{setspace}
8 \RequirePackage{type1cm}
9 \RequirePackage{amssymb}
10 \RequirePackage{amsmath}
11 \RequirePackage{paralist}
12 \RequirePackage[normalem]{ulem}
13 \RequirePackage{xifthen}
14 \RequirePackage{environ} % environments with \BODY, for wyimek
17 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 \usepackage[explicit]{titlesec}
26 \usepackage[MeX]{polski}
32 \usepackage[xetex]{graphicx}
33 \usepackage[silent]{fontspec} % silent - no warnings, quiet - warn only to log
36 %\usepackage{trimspaces} % imported by something else?
38 \usepackage[overload]{textcase}
40 \usepackage[colorlinks=false,linkcolor=white,pdfborder={0,0,0},setpagesize=false,urlcolor=black,xetex,linktocpage]{hyperref}
41 %\usepackage{hyperref}
43 \let\footnote=\endnote
44 \newcommand{\printfootnotes}{%
45 \markboth{\MakeTextUppercase{Przypisy}}{}
46 \renewcommand{\enoteheading}{}
51 \def\enotesize{\normalsize}
59 \usepackage[stable]{footmisc}
61 %http://tex.stackexchange.com/questions/40510/set-first-paragraph-no-indentation-after-re-definition-of-section#40512
64 \counterwithout{footnote}{chapter}
65 \usepackage{microtype}
71 \emergencystretch=30pt
76 %%%%%%%%%%%%%%%%%%%%%%% Paper size
81 top=\dimexpr22.578mm+28pt\relax,%
85 headsep=47pt,% 2x grid(14) - 9 (text font size) + 28pt
87 \setlength\columnsep{10mm}
88 \newlength\szpaltawidth
89 \setlength\szpaltawidth{80mm}
91 %%%%%%%%%%%%%%%%%%%%%%%% Fonts
94 ItalicFont = Lato-Italic,
96 BoldItalicFont = Lato-BoldItalic,
97 Ligatures={Common, Contextual},
98 SmallCapsFont = Lato-Regular,
99 SmallCapsFeatures={Letters=SmallCaps},
102 \newfontface\latoblack{Lato-Black}
103 \newfontface\headfont{LeagueGothic-Regular}
106 \setlength{\parindent}{3mm}
107 \setlength{\parskip}{0mm}
109 % \normalsize – normalny tekst
110 % \large - normalny tekst headingowy (nie wiem czy jest inny niz normalsize?)
111 % \Large - troche większy tekst headingowy (spis treści)
112 % \huge - pagina tytuł rozdziału
113 % \Huge - naglowek na szarym tle
115 % grid 14, normal 9/12,
116 % sródtytuły leage 10/8 14
117 % XXXX pagina: (mała? nie uzywana!)league 8, kerning 60 -› (30, 90), przy nowoczesna polska 100
118 % pagina: 28pt od top: 10mm CMY 0 75 100
119 % kolumna-›teskt base 2xgrid
120 % tabela header 14pt, LEAGE GOT RE [pad: left:3mm, 1,41mm od góry
122 % tabela kreska 0.7pt pomarancz, potem 0.5pt też pomarańcz
123 % tabela tekst: 8.5/11pt lato regular (wtedy pomaranczem wyróżnienia)
125 % (bez gridu) (abo 8.5/11pt reglar) , poza interlinią 1mm odpycha enter
128 % footer LATO BLACK 15 -- pagina(strona) TYLKO Z PRAWEJ
129 % footer srodek. league gothic 10 k70
130 % toc:wstep leag gothic 38 kern 75
131 % toc: 11pkt na grid 7
132 % marginesy: top: 22.578 mm bottom 24.439mm rynna 10; out 20mm, ins
134 % sród->text base 2xgrid
135 % toc: wstep->text 3xgrid,
136 % toc: left: 25mm right: 25mm
137 % toc długość tytułu (łamanie) 10m od końca
138 % toc: od numeru enspace (indent)
139 % footer 2xgrid od dołu 9.7mm
140 % master toc: margin left: -width - 10 / 2 ; 136mm [3x łam]
141 % footnotes SOURCE SANS PRO 8/11pt semibold na gridzie (ale nie musi) spacing
143 % master toc: 11pt/21pt leage na pół-grid (jak ejst mniejsze
144 % --licencja to 10pt!)
145 % master toc head 15pt,
146 % master toc wpisy: 11pt - (można 11pt + black)
147 % TYtUL leag gothi 46pt
150 \newcommand{\headingbig}{\fontsize{28}{28}\selectfont}
151 \renewcommand{\Huge}{\fontsize{38}{42}\selectfont}
152 \renewcommand{\huge}{\fontsize{15}{21}\selectfont}
153 \renewcommand{\LARGE}{\fontsize{14}{14}\selectfont}
154 \renewcommand{\large}{\fontsize{10}{14}\selectfont} % 21
155 \renewcommand{\Large}{\fontsize{11}{14}\selectfont}
156 \newcommand{\TOCtext}{\fontsize{11}{21}\selectfont}
157 \renewcommand{\normalsize}{\fontsize{9}{14}\selectfont}
158 \renewcommand{\footnotesize}{\fontsize{8}{10.5}\selectfont} %
159 \renewcommand{\scriptsize}{\fontsize{8.5}{11}\selectfont}
160 \newcommand{\titlesize}{\fontsize{46}{46}\selectfont}
161 \newcommand{\footerbig}{\fontsize{15}{15}\selectfont}
162 \newcommand{\footernormal}{\fontsize{10}{10}\selectfont}
165 %% \renewcommand{\normalsize}{\fontsize{10.4}{14.28}\addfontfeature{LetterSpace=3.0}\selectfont}
166 %% \renewcommand{\large}{\fontsize{14}{14.28}\addfontfeature{LetterSpace=3.0,Letters=Uppercase}\selectfont} % srodtytul
167 %% \renewcommand{\small}{\fontsize{8}{14.28}\addfontfeature{LetterSpace=5.0}\selectfont} % paginy
168 %% \renewcommand{\Large}{\fontsize{15}{21.42}\addfontfeature{LetterSpace=0.0}\selectfont} % tytuł rozdziału
169 %% \renewcommand{\huge}{\fontsize{18}{28.56}\addfontfeature{LetterSpace=1.0}\selectfont} % wyimek
170 %% \renewcommand{\Huge}{\fontsize{24}{40}\selectfont} % cover
171 %% \renewcommand{\footnotesize}{\addfontfeature{LetterSpace=1.0}\fontsize{9}{10.74}\selectfont}
175 % • • • • • • • • • COLORS • •
176 \definecolor{stoK}{cmyk}{0,0,0,1}
177 \definecolor{theme}{gray}{.3}
178 \definecolor{headcolor}{HTML}{EA5F21}
179 \definecolor{graybg}{cmyk}{0,0,0,0.55}
182 % • • • • • • • • METADATA • •
185 \newcommand{\@address}{}
186 \newcommand{\address}[1]{\renewcommand{\@address}{#1}}
189 % • • • • • • • • HEADINGS • •
190 %% this will go to \leftmark
195 \renewcommand{\chaptermark}[1]{\markboth{\MakeTextUppercase{#1}}{}}
196 % on the odd right : chapter title
197 \fancyhead[LE,RO]{{\color{headcolor}\headfont\headingbig\leftmark}}
198 \fancyfoot[RO]{{\color{gray}\latoblack\footerbig\thepage}}
199 \fancyfoot[RE]{{\color{gray}\headfont\footernormal\MakeTextUppercase{\@title}}}
200 \fancyfoot[LO]{{\color{gray}\headfont\footernormal\MakeTextUppercase{\@address}}}
202 \renewcommand{\headrulewidth}{0pt}
203 \renewcommand{\footrulewidth}{0pt}
206 %%%%%%%%%% Nagłówek pierwszej strony rozdziału
208 \fancypagestyle{plain}{%
210 \fancyfoot[RO]{{\color{gray}\latoblack\footerbig\thepage}}
211 \fancyfoot[LO]{{\color{gray}\headfont\footernormal\MakeTextUppercase{\@address}}}
215 % • • • • • • • • TITLES • • •
216 % no chapter numbers and no ``Rozdział'' word
217 %\renewcommand{\thechapter}{}
218 %\renewcommand{\chaptername}{}
220 % • chapter • • • • • • • • • •
223 %% \newsavebox{\chaptitlebox}
224 %% \newenvironment{chaptertitlebox}%
225 %% {\begin{lrbox}{\chaptitlebox}\begin{minipage}{\dimexpr\linewidth-0.5\columnsep\relax}}%
226 %% {\vfill\end{minipage}\end{lrbox}%
227 %% \vspace{-5mm}\colorbox{graybg}{\usebox{\chaptitlebox}}%
230 %% \begin{lrbox}{\@tempboxa}\begin{minipage}[t][\dimexpr\textheight-0.5cm\relax]{\dimexpr\linewidth-0.5\columnsep\relax}}{\end{minipage}\end{lrbox}%
231 %% \colorbox{graybg}{\raisebox{1cm}{\usebox{\@tempboxa}}}
235 \newcommand{\nochapternumbers}{
236 \renewcommand{\thesection}{\@arabic \c@section .}
241 \startcontents[chapter]
243 \newcommand{\chapterblock}[1]{%
245 \addcontentsline{toc}{chapter}{#1}%
246 \setlength{\fboxsep}{0pt}%
247 \noindent\colorbox{graybg}{%
250 \begin{minipage}[t][\dimexpr\textheight-28pt\relax]{\dimexpr\szpaltawidth-5mm\relax}%
251 \Huge{}\headfont\color{white}#1%
252 \vspace{\dimexpr21mm-11mm\relax}%
253 \par{\printcontents[chapter]{}{1}{}}
254 \end{minipage}%(testing)%\rule{0.1pt}{\baselineskip}%
256 \vspace{\dimexpr-\parskip-11pt\relax}%
259 \titlespacing*{\chapter}{0pt}{0pt}{0pt}
261 % • section • • • • • • • • • • • • • • •
262 \titleformat{\section}[runin]%
263 {\large\headfont%\nochapternumbers
265 {}{0pt}{\makebox[\linewidth][l]{\color{headcolor}\raggedright{}\thesection\enskip #1}%
266 % this is just to make the spacing between section and following
267 % text right (newlines produce strange amount of space
268 \makebox[\linewidth][l]{~}}%
270 \titlecontents{section}[0pt]{\headfont\Large\color{white}}%
271 {\thecontentslabel\enspace}{\contentsmargin{0pt}}%
272 {\hfill\color{white}{\thecontentspage}}
275 % \fboxsep=0pt % for framebox
276 % ramki wkokół elementów \fbox{}
277 %\titlespacing*{\section}{0pt}{0pt}{2\baselineskip}
280 %% \titleformat{\chapter}[block]%
281 %% {\Large\intro\addfontfeature{LetterSpace=0.5,Kerning={Uppercase}}}%
282 %% {}{0pt}{\parbox{80mm}{\raggedright#1}}
283 %% \newlength{\chapterposcorrection}\newlength{\chapterspaceafter}
284 %% \setlength{\chapterposcorrection}{-\headsep-2\baselineskip-2.352mm} % 2.352 is a measured correction:
285 %% \setlength{\chapterspaceafter}{14\baselineskip-14pt+2.352mm}%\f@size of large
286 %% \titlespacing*{\chapter}{0pt}{\chapterposcorrection}{\chapterspaceafter}
289 %% \titleformat{\section}%
290 %% {\addfontfeature{LetterSpace=0.3}\large}%
291 %% {\thesection{}.}{.5em}{\MakeTextUppercase{#1}}
292 %% \renewcommand{\thesection}{\Roman{section}}
293 %% \titlespacing*{\section}{0pt}{\baselineskip}{0em}
295 %% \titleformat{\subsection}[block]%
297 %% {\thesubsection{}.}{.5em}{\MakeTextUppercase{#1}.}[]
299 %% \renewcommand{\thesubsection}{\Alph{subsection}}
300 %% \titlespacing*{\subsection}{0pt}{\baselineskip}{0em}
302 %% \newcommand{\typosubsubsection}[1]{%
307 %%%%% Footnotes (works with footmisc) %%%%%%%%
308 \newlength{\footnoteindent}\newlength{\footnoteprespace}
309 \setlength{\footnoteindent}{8mm}%{3.5mm}
310 \setlength{\footnoteprespace}{0em}
313 \renewcommand\@makefnmark{%
314 \hspace{\footnoteprespace}
315 \hbox{{\normalfont \@thefnmark}}%
317 \renewcommand\thefootnote{[\arabic{footnote}]}
319 \setlength{\footnotemargin}{-\footnoteindent-\footnoteprespace-.3em}
320 \renewcommand\footnotelayout[1]{%
321 \setlength{\leftskip}{\footnoteindent}#1}
323 %% \long\def\@makefntext#1{%
324 %% \setlength{\leftskip}{\footnoteindent}%
325 %% \setlength{\hskip}{-\footnoteindent-\footnoteprespace-.1em}%
326 %% \hb@xt@ \dimexpr\footnoteindent+\footnoteprespace%
328 %% % \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1
332 \newlength{\myendnoteprespace}\setlength{\myendnoteprespace}{.5em}
333 \newlength{\myendnoteindent}\setlength{\myendnoteindent}{14mm+.5em}
335 \renewcommand\theendnote{[\roman{endnote}]}
336 \renewcommand\makeenmark{\hspace{\myendnoteprespace}\theenmark}
337 \renewcommand{\notesname}{}
338 \newcommand{\authornotes}{
341 \chapter{Przypisy autora}
342 \setlength{\parindent}{0pt}
343 \def\enotesize{\normalsize}
346 %% \newcommand{\@makeentext}[1]{%
347 %% \noindent\theenmark\hspace{\footnoteindent}#1
350 %% \def\enoteformat{\rightskip\z@ \parindent=0em
351 %% \makebox[\myendnoteindent][l]{\makeenmark}} % 12.4mm - measured biggest endnote marker (in Moglen text [xxxviii])
352 \def\enoteformat{\rightskip\z@ \setlength{\leftskip}{\myendnoteindent-\myendnoteprespace} \parindent=0em
353 \leavevmode\llap{\makebox[\myendnoteindent][l]{\makeenmark}}}
357 \def\trimspace#1{\trim@spaces{#1}}
361 %%%%%%%%%%%%%%%%%%%%%% Wyimki
362 %% \floatstyle{plain}
363 %% \newfloat{wyimekbox}{p}{wmk}
364 %% \floatname{wyimekbox}{Wyimek}
366 \NewEnviron{wyimek}{%
369 \PackageWarning{wlpub}{Wyimek on odd page, omitting it ( \BODY )}
373 \begin{minipage}[t][\textheight][c]{70mm}
382 %% wyimek that doesn't leave text in text flow
383 %% TODO: reduce code duplication
384 \NewEnviron{wyimekextra}{%
387 \PackageWarning{wlpub}{Wyimek on odd page, omitting it ( \BODY )}
391 \begin{minipage}[t][\textheight][c]{70mm}
402 %%%%%%%%%%%%%%%%%%%%%%%%%%
408 \doublehyphendemerits=9000
409 \finalhyphendemerits=6000
412 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
413 \newsavebox{\ximagebox}\newlength{\ximageheight}
414 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
415 \newcommand{\xbox}[1]
416 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximapgebox}}%
417 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
418 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
419 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
421 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
424 \newcommand{\makecover}{
428 %% \paperheight=210mm
430 \newgeometry{paperwidth=297mm,paperheight=210mm}
434 \thispagestyle{empty}
435 \newlength{\PictHOffset}
436 \newlength{\PictVOffset}
437 \setlength{\PictHOffset}{1in}
438 \addtolength{\PictHOffset}{\hoffset}
439 \addtolength{\PictHOffset}{\oddsidemargin}
441 \setlength{\PictVOffset}{1in}
442 \addtolength{\PictVOffset}{\voffset}
443 \addtolength{\PictVOffset}{\topmargin}
444 \addtolength{\PictVOffset}{\headheight}
445 \addtolength{\PictVOffset}{\headsep}
446 \addtolength{\PictVOffset}{\topskip}
448 \addtolength{\PictVOffset}{-\paperheight}
450 \noindent\hspace*{-\PictHOffset}%
451 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
452 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.pdf}}}
460 \renewcommand{\maketitle}{
461 %\vspace{\paperheight}
462 \thispagestyle{empty}
465 \thispagestyle{empty}
470 \Huge \noindent \thetitle
475 \vspace{\baselineskip}
486 %\indent\emph{You made this book possible.}
487 \vspace{7\baselineskip}
490 \includegraphics[scale=.2]{logo.eps}
496 \newcommand{\editorialsection}{
498 \thispagestyle{empty}
500 \setlength{\parindent}{0mm}
506 \renewcommand*\contentsname{Spis treści}
507 \newcommand{\spistresci}{
510 \setcounter{tocdepth}{0}
519 \newcommand{\tytul}[1]{%
524 \newcommand{\nazwapodutworu}[1]{%
528 \newcommand{\autorutworu}[1]{%
530 %\subsection*{\typosubsection{#1}}%
533 \newcommand{\dzielonadrzedne}[1]{%
537 \newcommand{\nazwautworu}[1]{%
541 \newcommand{\podtytul}[1]{%
542 \subsection*{\typosubsubsection{#1}}%
545 \newcommand{\podtytulpodutworu}[1]{%
546 \subsection*{\typosubsubsection{#1}}%
549 \newcommand{\translator}[1]{%
550 \subsection*{\typosubsubsection{tłum. #1}}%
552 \newcommand{\translatorsline}[1]{%
556 \newcommand{\powiesc}[1]{#1}
557 \newcommand{\opowiadanie}[1]{#1}
558 \newcommand{\lirykal}[1]{#1}
559 \newcommand{\lirykalp}[1]{#1}
560 \newcommand{\dramatwierszowanyl}[1]{#1}
561 \newcommand{\dramatwierszowanylp}[1]{#1}
562 \newcommand{\dramatwspolczesny}[1]{#1}
565 \newcommand{\dedykacja}[1]{%
573 \newcommand{\dlugicytat}[1]{%
575 \noindent{}\ignorespaces#1%
580 \newcommand{\poezjacyt}[1]{%
585 \newcommand{\motto}[1]{%
590 \newcommand{\listaosob}[2]{%
597 \newcommand{\nagloweklisty}[1]{%
598 \typosubsubsection{#1}%
601 \newcommand{\listaosoba}[1]{%
605 \newcommand{\kwestia}[1]{%
609 \newcommand{\naglowekakt}[1]{%
611 \subsection*{\typosubsection{#1}}%
613 \newcommand{\naglowekczesc}[1]{%
617 \newcommand{\srodtytul}[1]{%
621 \newcommand{\naglowekscena}[1]{%
622 \subsubsection*{\typosubsubsection{#1}}%
625 \newcommand{\theautorrozdzialu}{}
627 \newcommand{\autorrozdzialu}[1]{%
628 \renewcommand{\theautorrozdzialu}{{\normalfont\normalsize\newline{}\newline{}\parbox{\textwidth}{\normalsize\it #1}}}
632 \newcommand{\naglowekrozdzial}[1]{%
633 \startcontents[chapter]
639 \newcommand{\naglowekosoba}[1]{%
640 \par{\textsc{#1}}\nopagebreak%
642 \newcommand{\naglowekpodrozdzial}[1]{%
643 \section{#1}\nopagebreak%
645 \newcommand{\miejsceczas}[1]{%
648 \newcommand{\didaskalia}[1]{%
652 \newcommand{\akap}[1]{%
655 % newline here needed, we don't use \par cause it ignores \noindent before
657 \newcommand{\akapdialog}[1]{%
660 \newcommand{\akapcd}[1]{%
664 \newcommand{\mottopodpis}[1]{%
672 \newcommand{\strofa}[1]{%
673 #1\vspace{\baselineskip}%
676 \newcommand{\wers}[1]{#1}
678 \newcommand{\wersakap}[1]{%
681 \newcommand{\werscd}[1]{%
684 \newcommand{\werswciety}[2][1em]{%
689 \newcommand{\mat}[1]{$#1$}
691 \newcommand{\didasktekst}[1]{%
694 \newcommand{\slowoobce}[1]{%
699 \newif\ifinnota \innotafalse
701 \newcommand{\tytuldziela}[1]{%
710 \newcommand{\wyroznienie}[1]{%
714 \newcommand{\nota}[1]{%
719 \noindent{}\small{}#1%
726 \newcommand{\osoba}[1]{%
730 \newcommand{\sekcjaswiatlo}{%
731 \vspace{\baselineskip}%
734 \newcommand{\sekcjaasterysk}{%
735 \vspace{\baselineskip}%
741 \newcommand{\separatorlinia}{%
747 \newcommand{\ilustrscale}[0]{1}
748 \newcommand{\setilustrscale}[1]{\renewcomand{\ilustrscale}{#1}}
750 \newcommand{\ilustr}[3][]{
752 \ifthenelse{\isempty{#1}}%
753 {\par{\includegraphics{\trimspace{#2}}\\#3}}%
754 {\par{\includegraphics[#1]{\trimspace{#2}}\\#3}}%
759 \newcommand{\lista}[1]{%
761 %\setlength{\parskip}{\parindent}
766 \newcommand{\punkt}[1]{%
769 \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
771 \newcommand{\www}[1]{{\normalfont\href{#1}{#1}}}