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[landscape]{geometry}
24 \usepackage[explicit]{titlesec}
27 \usepackage[MeX]{polski}
33 \usepackage[xetex]{graphicx}
34 \usepackage[silent]{fontspec} % silent - no warnings, quiet - warn only to log
37 %\usepackage{trimspaces} % imported by something else?
39 \usepackage[overload]{textcase}
41 \usepackage[colorlinks=false,linkcolor=white,pdfborder={0,0,0},setpagesize=false,urlcolor=black,xetex,linktocpage]{hyperref}
42 %\usepackage{hyperref}
47 \usepackage[stable]{footmisc}
49 %http://tex.stackexchange.com/questions/40510/set-first-paragraph-no-indentation-after-re-definition-of-section#40512
52 \counterwithout{footnote}{chapter}
53 \usepackage{microtype}
59 \emergencystretch=30pt
64 %%%%%%%%%%%%%%%%%%%%%%% Paper size
65 %\setlength\baselineskip{7.14pt}
69 %% paperheight=225mm,%
70 %% text={117mm,162mm},%
74 %% right=30mm]{geometry}%
77 %% top=\dimexpr14.5mm+\baselineskip-16pt\relax, % margin will be smaller to accomodate for bigger header (16pt)
78 %% headsep=3\baselineskip,
83 %% textheight=\dimexpr7.14pt*(32*2+1)\relax,%
84 %% includehead]{geometry}
94 headsep=19pt,% 2x grid(14) - 9 (text font size)
96 \setlength\columnsep{10mm}
99 %%%%%%%%%%%%%%%%%%%%%%%% Fonts
102 ItalicFont = Lato-Italic,
103 BoldFont = Lato-Bold,
104 BoldItalicFont = Lato-BoldItalic,
105 Ligatures={Common, Contextual},
106 SmallCapsFont = Lato-Regular,
107 SmallCapsFeatures={Letters=SmallCaps},
110 \newfontface\latoblack{Lato-Black}
111 \newfontface\headfont{LeagueGothic-Regular}
114 \setlength{\parindent}{3mm}
115 \setlength{\parskip}{0mm}
117 % \normalsize – normalny tekst
118 % \large - normalny tekst headingowy (nie wiem czy jest inny niz normalsize?)
119 % \Large - troche większy tekst headingowy (spis treści)
120 % \huge - pagina tytuł rozdziału
121 % \Huge - naglowek na szarym tle
123 % grid 14, normal 9/12,
124 % sródtytuły leage 10/8 14
125 % XXXX pagina: (mała? nie uzywana!)league 8, kerning 60 -› (30, 90), przy nowoczesna polska 100
126 % pagina: 28pt od top: 10mm CMY 0 75 100
127 % kolumna-›teskt base 2xgrid
128 % tabela header 14pt, LEAGE GOT RE [pad: left:3mm, 1,41mm od góry
130 % tabela kreska 0.7pt pomarancz, potem 0.5pt też pomarańcz
131 % tabela tekst: 8.5/11pt lato regular (wtedy pomaranczem wyróżnienia)
133 % (bez gridu) (abo 8.5/11pt reglar) , poza interlinią 1mm odpycha enter
136 % footer LATO BLACK 15 -- pagina(strona) TYLKO Z PRAWEJ
137 % footer srodek. league gothic 10 k70
138 % toc:wstep leag gothic 38 kern 75
139 % toc: 11pkt na grid 7
140 % marginesy: top: 22.578 mm bottom 24.439mm rynna 10; out 20mm, ins
142 % sród->text base 2xgrid
143 % toc: wstep->text 3xgrid,
144 % toc: left: 25mm right: 25mm
145 % toc długość tytułu (łamanie) 10m od końca
146 % toc: od numeru enspace (indent)
147 % footer 2xgrid od dołu 9.7mm
148 % master toc: margin left: -width - 10 / 2 ; 136mm [3x łam]
149 % footnotes SOURCE SANS PRO 8/11pt semibold na gridzie (ale nie musi) spacing
151 % master toc: 11pt/21pt leage na pół-grid (jak ejst mniejsze
152 % --licencja to 10pt!)
153 % master toc head 15pt,
154 % master toc wpisy: 11pt - (można 11pt + black)
155 % TYtUL leag gothi 46pt
158 \newcommand{\headingbig}{\fontsize{28}{28}\selectfont}
159 \renewcommand{\Huge}{\fontsize{38}{42}\selectfont}
160 \renewcommand{\huge}{\fontsize{15}{21}\selectfont}
161 \renewcommand{\LARGE}{\fontsize{14}{14}\selectfont}
162 \renewcommand{\large}{\fontsize{10}{21}\selectfont}
163 \renewcommand{\Large}{\fontsize{11}{14}\selectfont}
164 \newcommand{\TOCtext}{\fontsize{11}{21}\selectfont}
165 \renewcommand{\normalsize}{\fontsize{9}{14}\selectfont}
166 \renewcommand{\footnotesize}{\fontsize{8}{10.5}\selectfont} %
167 \renewcommand{\scriptsize}{\fontsize{8.5}{11}\selectfont}
168 \newcommand{\titlesize}{\fontsize{46}{46}\selectfont}
169 \newcommand{\footerbig}{\fontsize{15}{15}\selectfont}
170 \newcommand{\footernormal}{\fontsize{10}{10}\selectfont}
173 %% \renewcommand{\normalsize}{\fontsize{10.4}{14.28}\addfontfeature{LetterSpace=3.0}\selectfont}
174 %% \renewcommand{\large}{\fontsize{14}{14.28}\addfontfeature{LetterSpace=3.0,Letters=Uppercase}\selectfont} % srodtytul
175 %% \renewcommand{\small}{\fontsize{8}{14.28}\addfontfeature{LetterSpace=5.0}\selectfont} % paginy
176 %% \renewcommand{\Large}{\fontsize{15}{21.42}\addfontfeature{LetterSpace=0.0}\selectfont} % tytuł rozdziału
177 %% \renewcommand{\huge}{\fontsize{18}{28.56}\addfontfeature{LetterSpace=1.0}\selectfont} % wyimek
178 %% \renewcommand{\Huge}{\fontsize{24}{40}\selectfont} % cover
179 %% \renewcommand{\footnotesize}{\addfontfeature{LetterSpace=1.0}\fontsize{9}{10.74}\selectfont}
183 % • • • • • • • • • COLORS • •
184 \definecolor{stoK}{cmyk}{0,0,0,1}
185 \definecolor{theme}{gray}{.3}
186 \definecolor{headcolor}{HTML}{EA5F21}
187 \definecolor{graybg}{cmyk}{0,0,0,0.55}
190 % • • • • • • • • METADATA • •
193 \newcommand{\@address}{}
194 \newcommand{\address}[1]{\renewcommand{\@address}{#1}}
197 % • • • • • • • • HEADINGS • •
198 %% this will go to \leftmark
203 \renewcommand{\chaptermark}[1]{\markboth{\MakeTextUppercase{#1}}{}}
204 % on the odd right : chapter title
205 \fancyhead[LE,RO]{{\color{headcolor}\headfont\headingbig\leftmark}}
206 \fancyfoot[RO]{{\color{gray}\latoblack\footerbig\thepage}}
207 \fancyfoot[RE]{{\color{gray}\headfont\footernormal\MakeTextUppercase{\@title}}}
208 \fancyfoot[LO]{{\color{gray}\headfont\footernormal\MakeTextUppercase{\@address}}}
210 \renewcommand{\headrulewidth}{0pt}
211 \renewcommand{\footrulewidth}{0pt}
214 %%%%%%%%%% Nagłówek pierwszej strony rozdziału
216 \fancypagestyle{plain}{%
218 \fancyfoot[RO]{{\color{gray}\latoblack\footerbig\thepage}}
219 \fancyfoot[LO]{{\color{gray}\headfont\footernormal\MakeTextUppercase{\@address}}}
223 % • • • • • • • • TITLES • • •
224 % no chapter numbers and no ``Rozdział'' word
225 %\renewcommand{\thechapter}{}
226 %\renewcommand{\chaptername}{}
228 % • chapter • • • • • • • • • •
229 \makeatletter\newenvironment{chaptertitlebox}{ \begin{lrbox}{\@tempboxa}\begin{minipage}[t][\dimexpr\textheight-0.5cm\relax]{\dimexpr\linewidth-0.5\columnsep\relax}}{\end{minipage}\end{lrbox}%
230 \colorbox{graybg}{\raisebox{1cm}{\usebox{\@tempboxa}}}
233 \newcommand{\nochapternumbers}{
234 \renewcommand{\thesection}{\@arabic \c@section .}
239 \startcontents[chapter]
240 \titleformat{\chapter}[block]%
241 {\begin{chaptertitlebox}}%
243 {\Huge{}\headfont\color{white}#1%
244 \newline\printcontents[chapter]{}{1}{}%
246 [\end{chaptertitlebox}]
248 \titlespacing*{\chapter}{0pt}{0pt}{0pt}
251 % • section • • • • • • • • • • • • • • •
252 \titleformat{\section}[runin]%
253 {\large\headfont%\nochapternumbers
255 {}{0pt}{\makebox[\linewidth][l]{\color{headcolor}\raggedright{}\thesection
257 % this is just to make the spacing between section and following
258 % text right (newlines produce strange amount of space
259 \\\makebox[\linewidth][l]{~}}%
261 \titlecontents{section}[0pt]{\headfont\large\color{white}}%
262 {\thecontentslabel}{\contentsmargin{0pt}}%
263 {\hfill\color{white}{\thecontentspage }}
266 % \fboxsep=0pt % for framebox
267 % ramki wkokół elementów \fbox{}
268 %\titlespacing*{\section}{0pt}{0pt}{2\baselineskip}
271 %% \titleformat{\chapter}[block]%
272 %% {\Large\intro\addfontfeature{LetterSpace=0.5,Kerning={Uppercase}}}%
273 %% {}{0pt}{\parbox{80mm}{\raggedright#1}}
274 %% \newlength{\chapterposcorrection}\newlength{\chapterspaceafter}
275 %% \setlength{\chapterposcorrection}{-\headsep-2\baselineskip-2.352mm} % 2.352 is a measured correction:
276 %% \setlength{\chapterspaceafter}{14\baselineskip-14pt+2.352mm}%\f@size of large
277 %% \titlespacing*{\chapter}{0pt}{\chapterposcorrection}{\chapterspaceafter}
280 %% \titleformat{\section}%
281 %% {\addfontfeature{LetterSpace=0.3}\large}%
282 %% {\thesection{}.}{.5em}{\MakeTextUppercase{#1}}
283 %% \renewcommand{\thesection}{\Roman{section}}
284 %% \titlespacing*{\section}{0pt}{\baselineskip}{0em}
286 %% \titleformat{\subsection}[block]%
288 %% {\thesubsection{}.}{.5em}{\MakeTextUppercase{#1}.}[]
290 %% \renewcommand{\thesubsection}{\Alph{subsection}}
291 %% \titlespacing*{\subsection}{0pt}{\baselineskip}{0em}
293 %% \newcommand{\typosubsubsection}[1]{%
298 %%%%% Footnotes (works with footmisc) %%%%%%%%
299 \newlength{\footnoteindent}\newlength{\footnoteprespace}
300 \setlength{\footnoteindent}{8mm}%{3.5mm}
301 \setlength{\footnoteprespace}{0em}
304 \renewcommand\@makefnmark{%
305 \hspace{\footnoteprespace}
306 \hbox{{\normalfont \@thefnmark}}%
308 \renewcommand\thefootnote{[\arabic{footnote}]}
310 \setlength{\footnotemargin}{-\footnoteindent-\footnoteprespace-.3em}
311 \renewcommand\footnotelayout[1]{%
312 \setlength{\leftskip}{\footnoteindent}#1}
314 %% \long\def\@makefntext#1{%
315 %% \setlength{\leftskip}{\footnoteindent}%
316 %% \setlength{\hskip}{-\footnoteindent-\footnoteprespace-.1em}%
317 %% \hb@xt@ \dimexpr\footnoteindent+\footnoteprespace%
319 %% % \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1
323 \newlength{\myendnoteprespace}\setlength{\myendnoteprespace}{.5em}
324 \newlength{\myendnoteindent}\setlength{\myendnoteindent}{14mm+.5em}
326 \renewcommand\theendnote{[\roman{endnote}]}
327 \renewcommand\makeenmark{\hspace{\myendnoteprespace}\theenmark}
328 \renewcommand{\notesname}{}
329 \newcommand{\authornotes}{
332 \chapter{Przypisy autora}
333 \setlength{\parindent}{0pt}
334 \def\enotesize{\normalsize}
337 %% \newcommand{\@makeentext}[1]{%
338 %% \noindent\theenmark\hspace{\footnoteindent}#1
341 %% \def\enoteformat{\rightskip\z@ \parindent=0em
342 %% \makebox[\myendnoteindent][l]{\makeenmark}} % 12.4mm - measured biggest endnote marker (in Moglen text [xxxviii])
343 \def\enoteformat{\rightskip\z@ \setlength{\leftskip}{\myendnoteindent-\myendnoteprespace} \parindent=0em
344 \leavevmode\llap{\makebox[\myendnoteindent][l]{\makeenmark}}}
348 \def\trimspace#1{\trim@spaces{#1}}
352 %%%%%%%%%%%%%%%%%%%%%% Wyimki
353 %% \floatstyle{plain}
354 %% \newfloat{wyimekbox}{p}{wmk}
355 %% \floatname{wyimekbox}{Wyimek}
357 \NewEnviron{wyimek}{%
360 \PackageWarning{wlpub}{Wyimek on odd page, omitting it ( \BODY )}
364 \begin{minipage}[t][\textheight][c]{70mm}
373 %% wyimek that doesn't leave text in text flow
374 %% TODO: reduce code duplication
375 \NewEnviron{wyimekextra}{%
378 \PackageWarning{wlpub}{Wyimek on odd page, omitting it ( \BODY )}
382 \begin{minipage}[t][\textheight][c]{70mm}
393 %%%%%%%%%%%%%%%%%%%%%%%%%%
399 \doublehyphendemerits=9000
400 \finalhyphendemerits=6000
403 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
404 \newsavebox{\ximagebox}\newlength{\ximageheight}
405 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
406 \newcommand{\xbox}[1]
407 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximapgebox}}%
408 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
409 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
410 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
412 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
415 \newcommand{\makecover}{
419 %% \paperheight=210mm
421 \newgeometry{paperwidth=297mm,paperheight=210mm}
425 \thispagestyle{empty}
426 \newlength{\PictHOffset}
427 \newlength{\PictVOffset}
428 \setlength{\PictHOffset}{1in}
429 \addtolength{\PictHOffset}{\hoffset}
430 \addtolength{\PictHOffset}{\oddsidemargin}
432 \setlength{\PictVOffset}{1in}
433 \addtolength{\PictVOffset}{\voffset}
434 \addtolength{\PictVOffset}{\topmargin}
435 \addtolength{\PictVOffset}{\headheight}
436 \addtolength{\PictVOffset}{\headsep}
437 \addtolength{\PictVOffset}{\topskip}
439 \addtolength{\PictVOffset}{-\paperheight}
441 \noindent\hspace*{-\PictHOffset}%
442 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
443 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.pdf}}}
451 \renewcommand{\maketitle}{
452 %\vspace{\paperheight}
453 \thispagestyle{empty}
456 \thispagestyle{empty}
461 \Huge \noindent \thetitle
466 \vspace{\baselineskip}
477 %\indent\emph{You made this book possible.}
478 \vspace{7\baselineskip}
481 \includegraphics[scale=.2]{logo.eps}
487 \newcommand{\editorialsection}{
489 \thispagestyle{empty}
491 \setlength{\parindent}{0mm}
497 \renewcommand*\contentsname{Spis treści}
498 \newcommand{\spistresci}{
501 \setcounter{tocdepth}{0}
510 \newcommand{\tytul}[1]{%
515 \newcommand{\nazwapodutworu}[1]{%
519 \newcommand{\autorutworu}[1]{%
521 %\subsection*{\typosubsection{#1}}%
524 \newcommand{\dzielonadrzedne}[1]{%
528 \newcommand{\nazwautworu}[1]{%
532 \newcommand{\podtytul}[1]{%
533 \subsection*{\typosubsubsection{#1}}%
536 \newcommand{\podtytulpodutworu}[1]{%
537 \subsection*{\typosubsubsection{#1}}%
540 \newcommand{\translator}[1]{%
541 \subsection*{\typosubsubsection{tłum. #1}}%
543 \newcommand{\translatorsline}[1]{%
547 \newcommand{\powiesc}[1]{#1}
548 \newcommand{\opowiadanie}[1]{#1}
549 \newcommand{\lirykal}[1]{#1}
550 \newcommand{\lirykalp}[1]{#1}
551 \newcommand{\dramatwierszowanyl}[1]{#1}
552 \newcommand{\dramatwierszowanylp}[1]{#1}
553 \newcommand{\dramatwspolczesny}[1]{#1}
556 \newcommand{\dedykacja}[1]{%
564 \newcommand{\dlugicytat}[1]{%
566 \noindent{}\ignorespaces#1%
571 \newcommand{\poezjacyt}[1]{%
576 \newcommand{\motto}[1]{%
581 \newcommand{\listaosob}[2]{%
588 \newcommand{\nagloweklisty}[1]{%
589 \typosubsubsection{#1}%
592 \newcommand{\listaosoba}[1]{%
596 \newcommand{\kwestia}[1]{%
600 \newcommand{\naglowekakt}[1]{%
602 \subsection*{\typosubsection{#1}}%
604 \newcommand{\naglowekczesc}[1]{%
608 \newcommand{\srodtytul}[1]{%
612 \newcommand{\naglowekscena}[1]{%
613 \subsubsection*{\typosubsubsection{#1}}%
616 \newcommand{\theautorrozdzialu}{}
618 \newcommand{\autorrozdzialu}[1]{%
619 \renewcommand{\theautorrozdzialu}{{\normalfont\normalsize\newline{}\newline{}\parbox{\textwidth}{\normalsize\it #1}}}
623 \newcommand{\naglowekrozdzial}[1]{%
624 \startcontents[chapter]
626 \chapter[#1]{\MakeUppercase{#1}\theautorrozdzialu{}}%
627 \renewcommand{\theautorrozdzialu}{}%
630 \newcommand{\naglowekosoba}[1]{%
631 \par{\textsc{#1}}\nopagebreak%
633 \newcommand{\naglowekpodrozdzial}[1]{%
634 \section{#1}\nopagebreak%
637 \newcommand{\miejsceczas}[1]{%
640 \newcommand{\didaskalia}[1]{%
644 \newcommand{\akap}[1]{%
647 % newline here needed, we don't use \par cause it ignores \noindent before
649 \newcommand{\akapdialog}[1]{%
652 \newcommand{\akapcd}[1]{%
656 \newcommand{\mottopodpis}[1]{%
664 \newcommand{\strofa}[1]{%
665 #1\vspace{\baselineskip}%
668 \newcommand{\wers}[1]{#1}
670 \newcommand{\wersakap}[1]{%
673 \newcommand{\werscd}[1]{%
676 \newcommand{\werswciety}[2][1em]{%
681 \newcommand{\mat}[1]{$#1$}
683 \newcommand{\didasktekst}[1]{%
686 \newcommand{\slowoobce}[1]{%
691 \newif\ifinnota \innotafalse
693 \newcommand{\tytuldziela}[1]{%
702 \newcommand{\wyroznienie}[1]{%
706 \newcommand{\nota}[1]{%
711 \noindent{}\small{}#1%
718 \newcommand{\osoba}[1]{%
722 \newcommand{\sekcjaswiatlo}{%
723 \vspace{\baselineskip}%
726 \newcommand{\sekcjaasterysk}{%
727 \vspace{\baselineskip}%
733 \newcommand{\separatorlinia}{%
739 \newcommand{\ilustrscale}[0]{1}
740 \newcommand{\setilustrscale}[1]{\renewcomand{\ilustrscale}{#1}}
742 \newcommand{\ilustr}[3][]{
744 \ifthenelse{\isempty{#1}}%
745 {\par{\includegraphics{\trimspace{#2}}\\#3}}%
746 {\par{\includegraphics[#1]{\trimspace{#2}}\\#3}}%
751 \newcommand{\lista}[1]{%
753 %\setlength{\parskip}{\parindent}
758 \newcommand{\punkt}[1]{%
761 \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
763 \newcommand{\www}[1]{{\normalfont\href{#1}{#1}}}