| 1 |
% !TEX TS-program = pdflatex |
| 2 |
% !TEX root = ../ArsClassica.tex |
| 3 |
|
| 4 |
%************************************************ |
| 5 |
\chapter{Code} |
| 6 |
\label{chp:code} |
| 7 |
%************************************************ |
| 8 |
|
| 9 |
\lstset{numbers=left, |
| 10 |
numberstyle=\scriptsize, |
| 11 |
stepnumber=1, |
| 12 |
numbersep=8pt |
| 13 |
} |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
Package announcement and request for necessary packages. |
| 18 |
\begin{lstlisting}[firstnumber=1] |
| 19 |
\NeedsTeXFormat{LaTeX2e} |
| 20 |
\ProvidesPackage{arsclassica}[2017/02/01] |
| 21 |
\RequirePackage{classicthesis} |
| 22 |
\RequirePackage{caption} |
| 23 |
\end{lstlisting} |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
Text body size. |
| 28 |
\begin{lstlisting} |
| 29 |
\areaset[current]{370pt}{784pt} |
| 30 |
\end{lstlisting} |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
Use of Iwona as font sans serif. |
| 35 |
\begin{lstlisting} |
| 36 |
\renewcommand{\sfdefault}{iwona} |
| 37 |
\end{lstlisting} |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
Customized chapter numbers. |
| 42 |
\begin{lstlisting} |
| 43 |
\let\chapterNumber\undefined |
| 44 |
\ifct@eulerchapternumbers |
| 45 |
\newfont{\chapterNumber}{eurb10 scaled 5000}% |
| 46 |
\else |
| 47 |
\newfont{\chapterNumber}{pplr9d scaled 5000}% |
| 48 |
\fi |
| 49 |
\end{lstlisting} |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
Smallcaps sans serif. |
| 54 |
\begin{lstlisting} |
| 55 |
\ifthenelse{\boolean{@minionprospacing}}% |
| 56 |
{% |
| 57 |
\DeclareRobustCommand{\spacedallcaps}[1]{\sffamily% |
| 58 |
\textssc{\MakeTextUppercase{#1}}}% |
| 59 |
\DeclareRobustCommand{\spacedlowsmallcaps}[1]% |
| 60 |
{\sffamily\textssc{\MakeTextLowercase{#1}}}% |
| 61 |
}{% |
| 62 |
\ifthenelse{\boolean{@pdfspacing}}% |
| 63 |
{% |
| 64 |
\microtypesetup{expansion=false}% |
| 65 |
\DeclareRobustCommand{\spacedallcaps}[1]% |
| 66 |
{\sffamily\textls[160]{\MakeTextUppercase{#1}}}% |
| 67 |
\DeclareRobustCommand{\spacedlowsmallcaps}[1]% |
| 68 |
{\sffamily\textls[80]{\scshape\MakeTextLowercase{#1}}}% |
| 69 |
}{% |
| 70 |
\RequirePackage{soul} |
| 71 |
\sodef\allcapsspacing{\sffamily\upshape}% |
| 72 |
{0.15em}{0.65em}{0.6em}% |
| 73 |
\sodef\lowsmallcapsspacing{\sffamily\scshape}% |
| 74 |
{0.075em}{0.5em}{0.6em}% |
| 75 |
\DeclareRobustCommand{\spacedallcaps}[1]% |
| 76 |
{\MakeTextUppercase{\allcapsspacing{#1}}}% |
| 77 |
\DeclareRobustCommand{\spacedlowsmallcaps}[1]% |
| 78 |
{\MakeTextLowercase{\textsc% |
| 79 |
{\lowsmallcapsspacing{#1}}}}% |
| 80 |
}% |
| 81 |
} |
| 82 |
\end{lstlisting} |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
Semi-transparent headlines and page numbers in Iwona. |
| 87 |
\begin{lstlisting} |
| 88 |
\renewcommand{\sectionmark}[1]{\markright{\textsc% |
| 89 |
{\MakeTextLowercase{\thesection}} \spacedlowsmallcaps{#1}}} |
| 90 |
\lehead{\mbox{\llap{\small\thepage\kern1em\color{halfgray}\vline}% |
| 91 |
\color{halfgray}\hspace{0.5em}\headmark\hfil}} |
| 92 |
\rohead{\mbox{\hfil{\color{halfgray}% |
| 93 |
\headmark\hspace{0.5em}}% |
| 94 |
\rlap{\small{\color{halfgray}\vline}\kern1em\thepage}}} |
| 95 |
\renewcommand{\headfont}{\normalfont\sffamily} |
| 96 |
\renewcommand{\pnumfont}{\small\sffamily} |
| 97 |
\end{lstlisting} |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
Sectioning unit titles and description list labels in Iwona. |
| 102 |
\begin{lstlisting} |
| 103 |
\RequirePackage{titlesec} |
| 104 |
% parts |
| 105 |
\ifthenelse{\boolean{@parts}}% |
| 106 |
{% |
| 107 |
\titleformat{\part}[display] |
| 108 |
{\normalfont\centering\large}% |
| 109 |
{\thispagestyle{empty}\partname~\thepart}{1em}% |
| 110 |
{\color{Maroon}\spacedallcaps} |
| 111 |
}{\relax} |
| 112 |
% chapters |
| 113 |
\ifthenelse{\boolean{@linedheaders}}% |
| 114 |
{% |
| 115 |
\titleformat{\chapter}[display]% |
| 116 |
{\relax}{\raggedleft{\color{halfgray}% |
| 117 |
\chapterNumber\thechapter} \\ }{0pt}% |
| 118 |
{\titlerule\vspace*{.9\baselineskip}\raggedright% |
| 119 |
\spacedallcaps}% |
| 120 |
[\normalsize\vspace*{.8\baselineskip}\titlerule]% |
| 121 |
}{% |
| 122 |
\titleformat{\chapter}[block]% |
| 123 |
{\normalfont\Large\sffamily}% |
| 124 |
{{\color{halfgray}\chapterNumber\thechapter% |
| 125 |
\hspace{10pt}\vline} }{10pt}% |
| 126 |
{\spacedallcaps}} |
| 127 |
% sections |
| 128 |
\titleformat{\section} |
| 129 |
{\normalfont\Large\sffamily}{\textsc% |
| 130 |
{\MakeTextLowercase{\thesection}}}% |
| 131 |
{1em}{\spacedlowsmallcaps} |
| 132 |
% subsections |
| 133 |
\titleformat{\subsection} |
| 134 |
{\normalfont\sffamily\bfseries}{\textsc{\MakeTextLowercase% |
| 135 |
{\thesubsection}}}{1em}{\normalsize} |
| 136 |
% subsubsections |
| 137 |
\titleformat{\subsubsection} |
| 138 |
{\normalfont\sffamily\bfseries\itshape}{\textsc% |
| 139 |
{\MakeTextLowercase{\thesubsubsection}}}% |
| 140 |
{1em}{\normalsize\itshape} |
| 141 |
% paragraphs |
| 142 |
\titleformat{\paragraph}[runin] |
| 143 |
{\normalfont\normalsize\sffamily\bfseries}{\textsc% |
| 144 |
{\MakeTextLowercase{\theparagraph}}}% |
| 145 |
{0pt}{\spacedlowsmallcaps} |
| 146 |
% description labels |
| 147 |
\renewcommand{\descriptionlabel}[1]{\hspace*{\labelsep}% |
| 148 |
\bfseries\spacedlowsmallcaps{#1}} |
| 149 |
\titlespacing*{\chapter}{0pt}{1\baselineskip}{2\baselineskip} |
| 150 |
\titlespacing*{\section}{0pt}{2\baselineskip}% |
| 151 |
{.8\baselineskip}[\marginparsep] |
| 152 |
\titlespacing*{\subsection}{0pt}{1.5\baselineskip}% |
| 153 |
{.8\baselineskip}[\marginparsep] |
| 154 |
\titlespacing*{\paragraph}{0pt}{1\baselineskip}{1\baselineskip} |
| 155 |
|
| 156 |
\newcommand\formatchapter[1]{% |
| 157 |
\vbox to \ht\strutbox{ |
| 158 |
\setbox0=\hbox{\chapterNumber\thechapter\hspace{10pt}\vline\ } |
| 159 |
\advance\hsize-\wd0 \advance\hsize-10pt\raggedright |
| 160 |
\spacedallcaps{#1}\vss}} |
| 161 |
\titleformat{\chapter}[block] |
| 162 |
{\normalfont\Large\sffamily} |
| 163 |
{\textcolor{halfgray}{\chapterNumber\thechapter} |
| 164 |
\hspace{10pt}\vline\ }{10pt} |
| 165 |
{\formatchapter} |
| 166 |
|
| 167 |
\clearscrplain |
| 168 |
\rofoot[\mbox{\makebox[0pt][l]{\kern1em\thepage}}]{} |
| 169 |
\end{lstlisting} |
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
Itemize lists with semi-transparent labels. |
| 174 |
\begin{lstlisting} |
| 175 |
\renewcommand\labelitemi{\color{halfgray}$\bullet$} |
| 176 |
\end{lstlisting} |
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
Caption settings. |
| 181 |
\begin{lstlisting} |
| 182 |
\captionsetup{format=hang,font=small,labelfont={sf,bf}} |
| 183 |
\captionsetup[table]{skip=\medskipamount} |
| 184 |
\end{lstlisting} |
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
Hyper-reference settings. |
| 189 |
\begin{lstlisting} |
| 190 |
\hypersetup{ |
| 191 |
colorlinks=true, linktocpage=true, pdfstartpage=1, |
| 192 |
pdfstartview=FitV, breaklinks=true, pdfpagemode=UseNone, |
| 193 |
pageanchor=true, pdfpagemode=UseOutlines, |
| 194 |
plainpages=false, bookmarksnumbered, |
| 195 |
bookmarksopen=true, bookmarksopenlevel=1, |
| 196 |
hypertexnames=true, pdfhighlight=/O, |
| 197 |
urlcolor=webbrown, linkcolor=RoyalBlue, |
| 198 |
citecolor=webgreen, |
| 199 |
hyperfootnotes=false, pdfpagelabels, |
| 200 |
pdfcreator={pdfLaTeX}, |
| 201 |
pdfproducer={LaTeX with ArsClassica} |
| 202 |
} |
| 203 |
\end{lstlisting} |