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}{21}\selectfont}
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 • • • • • • • • • •
221 \makeatletter\newenvironment{chaptertitlebox}{ \begin{lrbox}{\@tempboxa}\begin{minipage}[t][\dimexpr\textheight-0.5cm\relax]{\dimexpr\linewidth-0.5\columnsep\relax}}{\end{minipage}\end{lrbox}%
222 \colorbox{graybg}{\raisebox{1cm}{\usebox{\@tempboxa}}}
225 \newcommand{\nochapternumbers}{
226 \renewcommand{\thesection}{\@arabic \c@section .}
231 \startcontents[chapter]
232 \titleformat{\chapter}[block]%
233 {\begin{chaptertitlebox}}%
235 {\Huge{}\headfont\color{white}#1%
236 \newline\printcontents[chapter]{}{1}{}%
238 [\end{chaptertitlebox}]
240 \titlespacing*{\chapter}{0pt}{0pt}{0pt}
243 % • section • • • • • • • • • • • • • • •
244 \titleformat{\section}[runin]%
245 {\large\headfont%\nochapternumbers
247 {}{0pt}{\makebox[\linewidth][l]{\color{headcolor}\raggedright{}\thesection
249 % this is just to make the spacing between section and following
250 % text right (newlines produce strange amount of space
251 \\\makebox[\linewidth][l]{~}}%
253 \titlecontents{section}[0pt]{\headfont\large\color{white}}%
254 {\thecontentslabel}{\contentsmargin{0pt}}%
255 {\hfill\color{white}{\thecontentspage }}
258 % \fboxsep=0pt % for framebox
259 % ramki wkokół elementów \fbox{}
260 %\titlespacing*{\section}{0pt}{0pt}{2\baselineskip}
263 %% \titleformat{\chapter}[block]%
264 %% {\Large\intro\addfontfeature{LetterSpace=0.5,Kerning={Uppercase}}}%
265 %% {}{0pt}{\parbox{80mm}{\raggedright#1}}
266 %% \newlength{\chapterposcorrection}\newlength{\chapterspaceafter}
267 %% \setlength{\chapterposcorrection}{-\headsep-2\baselineskip-2.352mm} % 2.352 is a measured correction:
268 %% \setlength{\chapterspaceafter}{14\baselineskip-14pt+2.352mm}%\f@size of large
269 %% \titlespacing*{\chapter}{0pt}{\chapterposcorrection}{\chapterspaceafter}
272 %% \titleformat{\section}%
273 %% {\addfontfeature{LetterSpace=0.3}\large}%
274 %% {\thesection{}.}{.5em}{\MakeTextUppercase{#1}}
275 %% \renewcommand{\thesection}{\Roman{section}}
276 %% \titlespacing*{\section}{0pt}{\baselineskip}{0em}
278 %% \titleformat{\subsection}[block]%
280 %% {\thesubsection{}.}{.5em}{\MakeTextUppercase{#1}.}[]
282 %% \renewcommand{\thesubsection}{\Alph{subsection}}
283 %% \titlespacing*{\subsection}{0pt}{\baselineskip}{0em}
285 %% \newcommand{\typosubsubsection}[1]{%
290 %%%%% Footnotes (works with footmisc) %%%%%%%%
291 \newlength{\footnoteindent}\newlength{\footnoteprespace}
292 \setlength{\footnoteindent}{8mm}%{3.5mm}
293 \setlength{\footnoteprespace}{0em}
296 \renewcommand\@makefnmark{%
297 \hspace{\footnoteprespace}
298 \hbox{{\normalfont \@thefnmark}}%
300 \renewcommand\thefootnote{[\arabic{footnote}]}
302 \setlength{\footnotemargin}{-\footnoteindent-\footnoteprespace-.3em}
303 \renewcommand\footnotelayout[1]{%
304 \setlength{\leftskip}{\footnoteindent}#1}
306 %% \long\def\@makefntext#1{%
307 %% \setlength{\leftskip}{\footnoteindent}%
308 %% \setlength{\hskip}{-\footnoteindent-\footnoteprespace-.1em}%
309 %% \hb@xt@ \dimexpr\footnoteindent+\footnoteprespace%
311 %% % \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1
315 \newlength{\myendnoteprespace}\setlength{\myendnoteprespace}{.5em}
316 \newlength{\myendnoteindent}\setlength{\myendnoteindent}{14mm+.5em}
318 \renewcommand\theendnote{[\roman{endnote}]}
319 \renewcommand\makeenmark{\hspace{\myendnoteprespace}\theenmark}
320 \renewcommand{\notesname}{}
321 \newcommand{\authornotes}{
324 \chapter{Przypisy autora}
325 \setlength{\parindent}{0pt}
326 \def\enotesize{\normalsize}
329 %% \newcommand{\@makeentext}[1]{%
330 %% \noindent\theenmark\hspace{\footnoteindent}#1
333 %% \def\enoteformat{\rightskip\z@ \parindent=0em
334 %% \makebox[\myendnoteindent][l]{\makeenmark}} % 12.4mm - measured biggest endnote marker (in Moglen text [xxxviii])
335 \def\enoteformat{\rightskip\z@ \setlength{\leftskip}{\myendnoteindent-\myendnoteprespace} \parindent=0em
336 \leavevmode\llap{\makebox[\myendnoteindent][l]{\makeenmark}}}
340 \def\trimspace#1{\trim@spaces{#1}}
344 %%%%%%%%%%%%%%%%%%%%%% Wyimki
345 %% \floatstyle{plain}
346 %% \newfloat{wyimekbox}{p}{wmk}
347 %% \floatname{wyimekbox}{Wyimek}
349 \NewEnviron{wyimek}{%
352 \PackageWarning{wlpub}{Wyimek on odd page, omitting it ( \BODY )}
356 \begin{minipage}[t][\textheight][c]{70mm}
365 %% wyimek that doesn't leave text in text flow
366 %% TODO: reduce code duplication
367 \NewEnviron{wyimekextra}{%
370 \PackageWarning{wlpub}{Wyimek on odd page, omitting it ( \BODY )}
374 \begin{minipage}[t][\textheight][c]{70mm}
385 %%%%%%%%%%%%%%%%%%%%%%%%%%
391 \doublehyphendemerits=9000
392 \finalhyphendemerits=6000
395 % see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html
396 \newsavebox{\ximagebox}\newlength{\ximageheight}
397 \newsavebox{\xglyphbox}\newlength{\xglyphheight}
398 \newcommand{\xbox}[1]
399 {\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximapgebox}}%
400 \savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}%
401 \raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{%
402 \makebox[0pt][l]{\usebox{\xglyphbox}}}%}%
404 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
407 \newcommand{\makecover}{
411 %% \paperheight=210mm
413 \newgeometry{paperwidth=297mm,paperheight=210mm}
417 \thispagestyle{empty}
418 \newlength{\PictHOffset}
419 \newlength{\PictVOffset}
420 \setlength{\PictHOffset}{1in}
421 \addtolength{\PictHOffset}{\hoffset}
422 \addtolength{\PictHOffset}{\oddsidemargin}
424 \setlength{\PictVOffset}{1in}
425 \addtolength{\PictVOffset}{\voffset}
426 \addtolength{\PictVOffset}{\topmargin}
427 \addtolength{\PictVOffset}{\headheight}
428 \addtolength{\PictVOffset}{\headsep}
429 \addtolength{\PictVOffset}{\topskip}
431 \addtolength{\PictVOffset}{-\paperheight}
433 \noindent\hspace*{-\PictHOffset}%
434 \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
435 \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.pdf}}}
443 \renewcommand{\maketitle}{
444 %\vspace{\paperheight}
445 \thispagestyle{empty}
448 \thispagestyle{empty}
453 \Huge \noindent \thetitle
458 \vspace{\baselineskip}
469 %\indent\emph{You made this book possible.}
470 \vspace{7\baselineskip}
473 \includegraphics[scale=.2]{logo.eps}
479 \newcommand{\editorialsection}{
481 \thispagestyle{empty}
483 \setlength{\parindent}{0mm}
489 \renewcommand*\contentsname{Spis treści}
490 \newcommand{\spistresci}{
493 \setcounter{tocdepth}{0}
502 \newcommand{\tytul}[1]{%
507 \newcommand{\nazwapodutworu}[1]{%
511 \newcommand{\autorutworu}[1]{%
513 %\subsection*{\typosubsection{#1}}%
516 \newcommand{\dzielonadrzedne}[1]{%
520 \newcommand{\nazwautworu}[1]{%
524 \newcommand{\podtytul}[1]{%
525 \subsection*{\typosubsubsection{#1}}%
528 \newcommand{\podtytulpodutworu}[1]{%
529 \subsection*{\typosubsubsection{#1}}%
532 \newcommand{\translator}[1]{%
533 \subsection*{\typosubsubsection{tłum. #1}}%
535 \newcommand{\translatorsline}[1]{%
539 \newcommand{\powiesc}[1]{#1}
540 \newcommand{\opowiadanie}[1]{#1}
541 \newcommand{\lirykal}[1]{#1}
542 \newcommand{\lirykalp}[1]{#1}
543 \newcommand{\dramatwierszowanyl}[1]{#1}
544 \newcommand{\dramatwierszowanylp}[1]{#1}
545 \newcommand{\dramatwspolczesny}[1]{#1}
548 \newcommand{\dedykacja}[1]{%
556 \newcommand{\dlugicytat}[1]{%
558 \noindent{}\ignorespaces#1%
563 \newcommand{\poezjacyt}[1]{%
568 \newcommand{\motto}[1]{%
573 \newcommand{\listaosob}[2]{%
580 \newcommand{\nagloweklisty}[1]{%
581 \typosubsubsection{#1}%
584 \newcommand{\listaosoba}[1]{%
588 \newcommand{\kwestia}[1]{%
592 \newcommand{\naglowekakt}[1]{%
594 \subsection*{\typosubsection{#1}}%
596 \newcommand{\naglowekczesc}[1]{%
600 \newcommand{\srodtytul}[1]{%
604 \newcommand{\naglowekscena}[1]{%
605 \subsubsection*{\typosubsubsection{#1}}%
608 \newcommand{\theautorrozdzialu}{}
610 \newcommand{\autorrozdzialu}[1]{%
611 \renewcommand{\theautorrozdzialu}{{\normalfont\normalsize\newline{}\newline{}\parbox{\textwidth}{\normalsize\it #1}}}
615 \newcommand{\naglowekrozdzial}[1]{%
616 \startcontents[chapter]
618 \chapter[#1]{\MakeUppercase{#1}\theautorrozdzialu{}}%
619 \renewcommand{\theautorrozdzialu}{}%
622 \newcommand{\naglowekosoba}[1]{%
623 \par{\textsc{#1}}\nopagebreak%
625 \newcommand{\naglowekpodrozdzial}[1]{%
626 \section{#1}\nopagebreak%
629 \newcommand{\miejsceczas}[1]{%
632 \newcommand{\didaskalia}[1]{%
636 \newcommand{\akap}[1]{%
639 % newline here needed, we don't use \par cause it ignores \noindent before
641 \newcommand{\akapdialog}[1]{%
644 \newcommand{\akapcd}[1]{%
648 \newcommand{\mottopodpis}[1]{%
656 \newcommand{\strofa}[1]{%
657 #1\vspace{\baselineskip}%
660 \newcommand{\wers}[1]{#1}
662 \newcommand{\wersakap}[1]{%
665 \newcommand{\werscd}[1]{%
668 \newcommand{\werswciety}[2][1em]{%
673 \newcommand{\mat}[1]{$#1$}
675 \newcommand{\didasktekst}[1]{%
678 \newcommand{\slowoobce}[1]{%
683 \newif\ifinnota \innotafalse
685 \newcommand{\tytuldziela}[1]{%
694 \newcommand{\wyroznienie}[1]{%
698 \newcommand{\nota}[1]{%
703 \noindent{}\small{}#1%
710 \newcommand{\osoba}[1]{%
714 \newcommand{\sekcjaswiatlo}{%
715 \vspace{\baselineskip}%
718 \newcommand{\sekcjaasterysk}{%
719 \vspace{\baselineskip}%
725 \newcommand{\separatorlinia}{%
731 \newcommand{\ilustrscale}[0]{1}
732 \newcommand{\setilustrscale}[1]{\renewcomand{\ilustrscale}{#1}}
734 \newcommand{\ilustr}[3][]{
736 \ifthenelse{\isempty{#1}}%
737 {\par{\includegraphics{\trimspace{#2}}\\#3}}%
738 {\par{\includegraphics[#1]{\trimspace{#2}}\\#3}}%
743 \newcommand{\lista}[1]{%
745 %\setlength{\parskip}{\parindent}
750 \newcommand{\punkt}[1]{%
753 \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
755 \newcommand{\www}[1]{{\normalfont\href{#1}{#1}}}