X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/bf4c4a671ebe4dfedfa97e3ec56e70261987d512..3c76f9d5ad9161f8155b8f063a5494d966c2bbe7:/librarian/pdf/wlpub.cls diff --git a/librarian/pdf/wlpub.cls b/librarian/pdf/wlpub.cls index 4ed3d0e..fb9e7bd 100644 --- a/librarian/pdf/wlpub.cls +++ b/librarian/pdf/wlpub.cls @@ -19,6 +19,9 @@ \RequirePackage{amsmath} \RequirePackage{paralist} \RequirePackage[normalem]{ulem} +\RequirePackage{xifthen} +\RequirePackage{environ} % environments with \BODY, for wyimek + %\DeclareOption{13pt}{% %\AtEndOfClass{% % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ @@ -85,19 +88,31 @@ \usepackage{fontspec} \usepackage{xunicode} \usepackage{xltxtra} -\usepackage{trimspaces} +%\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[explicit]{titlesec} -\usepackage{fnpos} + +%\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} + \pagestyle{plain} % bottom figure below footnotes -\makeFNabove +%\makeFNabove %%%%%%%%%%%%%%%%%%%%%%% Paper size @@ -106,14 +121,14 @@ \usepackage[% paperwidth=160mm,% paperheight=225mm,% - text={117mm,162mm},% - top=30mm,% + 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) + top=\dimexpr14.5mm+\baselineskip-16pt\relax, % margin will be smaller to accomodate for bigger header (16pt) headsep=3\baselineskip, headheight=16pt, bottom=26.3mm,% @@ -150,17 +165,16 @@ Mapping=tex-text } \makeatother - -\renewcommand{\normalsize}{\fontsize{10.4}{14.28}\addfontfeature{LetterSpace=0.3}\selectfont} -\setlength{\parindent}{4mm} +\setlength{\parindent}{3mm} \setlength{\parskip}{0mm} -\renewcommand{\large}{\fontsize{14}{14.28}\selectfont} % srodtytul -\renewcommand{\small}{\fontsize{8}{14.28}\selectfont} % paginy -\renewcommand{\Large}{\fontsize{15}{21.42}\selectfont} % tytuł rozdziału -\renewcommand{\huge}{\fontsize{18}{21.6}\selectfont} % wyimek +\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}{\fontsize{9}{10.74}\selectfont} +\renewcommand{\footnotesize}{\addfontfeature{LetterSpace=1.0}\fontsize{9}{10.74}\selectfont} @@ -191,26 +205,28 @@ Mapping=tex-text \makeatother %%%%%%%%%%%%%%%%%%%%%% Section title styles. -%% Sections +%% Chapters \titleformat{\chapter}[block]% {\Large\intro\addfontfeature{LetterSpace=0.5,Kerning={Uppercase}}}% -{}{0pt}{\parbox{80mm}{\raggedright\MakeUppercase{#1}}} +{}{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}% {\addfontfeature{LetterSpace=0.3}\large}% -{\thesection}{.5em}{\MakeUppercase{#1}} +{\thesection{}.}{.5em}{\MakeUppercase{#1}} \renewcommand{\thesection}{\Roman{section}} -\titleformat{\subsection}% +\titleformat{\subsection}[runin]% {}% -{\thesubsection}{0pt}{\fakesc{#1}} +{\thesubsection{}.}{.5em}{\MakeUppercase{#1}.}[] +\renewcommand{\thesubsection}{\Alph{subsection}} +\titlespacing*{\subsection}{0pt}{0pt}{.5em} \newcommand{\typosubsubsection}[1]{% {\textsc{#1}} @@ -227,29 +243,62 @@ Mapping=tex-text } %%%%%%%%%%%%%%%%%% ^^ -%%%%% Footnotes %%%%%%%% +%%%%% Footnotes (works with footmisc) %%%%%%%% \newlength{\footnoteindent}\newlength{\footnoteprespace} \setlength{\footnoteindent}{6mm}%{3.5mm} -\setlength{\footnoteprespace}{.3em} +\setlength{\footnoteprespace}{0em} \makeatletter \renewcommand\@makefnmark{% -\hspace{\footnoteprespace}\hbox{{\normalfont \@thefnmark}}% +\hspace{\footnoteprespace} +\hbox{{\normalfont \@thefnmark}}% } \renewcommand\thefootnote{[\arabic{footnote}]} -\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 -} +\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 @@ -259,7 +308,7 @@ Mapping=tex-text \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}}}%}% @@ -268,9 +317,14 @@ Mapping=tex-text \newcommand{\makecover}{ + %% \paperwidth=297mm + - %\pdfpagewidth=#1 - %\pdfpageheight=#2 + %% \paperheight=210mm + + \newgeometry{paperwidth=297mm,paperheight=210mm} + \pdfpageheight=210mm + \pdfpagewidth=297mm \thispagestyle{empty} \newlength{\PictHOffset} @@ -290,11 +344,19 @@ Mapping=tex-text \noindent\hspace*{-\PictHOffset}% \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{% - \includegraphics[height=\paperheight,width=\paperwidth]{cover.jpg}}} - \newpage - %\vspace{\paperheight} + \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.pdf}}} + + \restoregeometry + \pdfpageheight=210mm + \pdfpagewidth=148mm + } +\renewcommand{\maketitle}{ + %\vspace{\paperheight} + \thispagestyle{empty} + \cleardoublepage + \setcounter{page}{1} \thispagestyle{empty} \begin{center} \intro @@ -305,51 +367,49 @@ Mapping=tex-text } \end{center} - \vspace{2em} - + \vspace{\baselineskip} + \begin{center} \intro { - \huge \noindent \theauthor + \huge \noindent + \theauthor + } \end{center} %\emph{\thankyou}\\ %\indent\emph{You made this book possible.} - \vspace{16em} + \vspace{7\baselineskip} \begin{center} \includegraphics[scale=.2]{logo.eps} \end{center} - \newpage - \thispagestyle{empty} - - \input{editorial} - - - } - - - -\renewcommand{\maketitle}{ - { - \thispagestyle{empty} - \footnotesize - \color{theme} - \noindent \rule{\linewidth}{0.4pt} - - \vspace{.6em} - \color{black} - } } \newcommand{\editorialsection}{ + \clearpage + \thispagestyle{empty} + { + \setlength{\parindent}{0mm} + \input{editorial} + } +} +\renewcommand*\contentsname{Spis treści} +\newcommand{\spistresci}{ +{ + \intro + \setcounter{tocdepth}{0} + \tableofcontents + \newpage +} } + \newcommand{\tytul}[1]{% #1% \vspace{1em}% @@ -397,9 +457,9 @@ Mapping=tex-text \newcommand{\nota}[1]{% \begin{em}% -\begin{flushright}% -#1% -\end{flushright}% +\begin{flushleft}% +\noindent #1% +\end{flushleft}% \end{em}% } @@ -455,7 +515,7 @@ Mapping=tex-text \part{#1}% } \newcommand{\srodtytul}[1]{% -\subsection*{\typosubsection{#1}}% +\subsection{#1}% } \newcommand{\naglowekscena}[1]{% @@ -465,11 +525,13 @@ Mapping=tex-text \newcommand{\theautorrozdzialu}{} \newcommand{\autorrozdzialu}[1]{% -\renewcommand{\theautorrozdzialu}{\newline\newline#1} +\renewcommand{\theautorrozdzialu}{{\normalfont\normalsize\newline{}\newline{}\emph{#1}}} } + \newcommand{\naglowekrozdzial}[1]{% -\chapter{#1\theautorrozdzialu{}}\renewcommand{\theautorrozdzialu}{}% +\chapter[#1]{\MakeUppercase{#1}\theautorrozdzialu{}} +\renewcommand{\theautorrozdzialu}{}% } \newcommand{\naglowekosoba}[1]{% @@ -552,7 +614,7 @@ Mapping=tex-text } \newcommand{\sekcjaswiatlo}{% -\vspace{30pt}% +\vspace{\baselineskip}% } \newcommand{\sekcjaasterysk}{% @@ -568,12 +630,17 @@ Mapping=tex-text \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}% - \par{\includegraphics[width=\textwidth]{\trimspace{#1}}\\#2}% + \ifthenelse{\isempty{#1}}% + {\par{\includegraphics{\trimspace{#2}}\\#3}}% + {\par{\includegraphics[#1]{\trimspace{#2}}\\#3}}% \end{center}% - \vspace{1em}% + \vspace{2\baselineskip}% } @@ -592,6 +659,7 @@ Mapping=tex-text \newcommand{\lista}[1]{% \begin{compactitem} +\setlength{\parskip}{\parindent} #1 \end{compactitem} } @@ -601,5 +669,4 @@ Mapping=tex-text } \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}} -\newcommand{\www}[1]{\url{#1}} - +\newcommand{\www}[1]{{\normalfont\small\href{#1}{#1}}}