many updates
[phd-thesis.git] / preamble.tex
1 % Input encoding
2 \usepackage[utf8]{inputenc}
3
4 % Papersize
5 \usepackage{geometry}
6 \geometry{
7 inner=25mm,
8 outer=20mm,
9 marginparsep=3mm,
10 marginparwidth=13mm,
11 top=25mm,
12 bottom=20mm,
13 paperwidth=17cm,
14 paperheight=24cm,
15 }
16
17 % Font encoding
18 \usepackage[T1,T2A]{fontenc}
19
20 % standalone figures
21 \usepackage[subpreambles=true]{standalone}
22
23 % Less bad boxes
24 \usepackage{microtype}
25
26 % No more room for a new \write
27 \usepackage{morewrites}
28
29 % Internationalisation
30 \usepackage[dutch,russian,british]{babel}
31 %\babelfont[russian]{rm}{Liberation Serif}
32
33 % Appendices (used for subappendices, appendices per chapter)
34 \usepackage{appendix}
35
36 % Cite bib entry completely
37 \usepackage{bibentry}
38 \nobibliography*
39
40 % Hyperlinks
41 \usepackage{bookmark,hyperref}
42 %\usepackage[pagebackref]{bookmark,hyperref}
43 % Setup pdf parameters: TODO
44 \hypersetup{%
45 pdftitle={\mytitle},
46 pdfauthor={\myauthor},
47 pdfsubject={},
48 % pdfcreator={},
49 % pdfproducer={},
50 pdfkeywords={task-oriented programming, functional programming, domain specific languages, internet of things},
51 hidelinks,
52 }
53 \urlstyle{same}
54 \usepackage{xmpincl}
55 \includexmp{CC_Attribution-NoDerivatives_4.0_International}
56
57 % Graphics
58 \usepackage{graphicx}
59 % Images directory
60 \graphicspath{{img/}}
61 %subfigures
62 \usepackage{caption}
63 \usepackage{subcaption}
64
65 % Nice tables
66 \usepackage{booktabs}
67 % Multirow cells
68 \usepackage{multirow}
69
70 % orcid icon
71 \usepackage{academicons}
72 \newcommand{\orcid}[1]{\href{https://orcid.org/#1}{\hspace{1mm}\includegraphics[width=1em]{orcid}\hspace{2mm} https://orcid.org/#1}}
73
74 % IPA symbols
75 \usepackage{tipa}
76
77 % Automatically wrapping tables
78 \usepackage{tabularx}
79
80 % Use a fixed document date
81 \usepackage[nodayofweek]{datetime}
82
83 % Code
84 \usepackage{stmaryrd} % Short arrow
85 \usepackage{textcomp} % upquote
86 \usepackage{listings}
87 % General listings settings
88 \lstset{%
89 basewidth=0.45em,
90 basicstyle=\tt\small,
91 breakatwhitespace=false,
92 breaklines=true,
93 captionpos=b,
94 columns=[c]fixed,
95 commentstyle=\sl,
96 escapeinside={(+}{+)}, % chktex 9
97 frame=L,
98 keepspaces=true,
99 keywordstyle=\bf,
100 postbreak=\mbox{\textcolor{gray}{$\hookrightarrow$}\space},
101 showspaces=false,
102 showstringspaces=false,
103 showtabs=false,
104 stringstyle=\it,
105 tabsize=4,
106 upquote=true,
107 }
108 \usepackage{lstlangclean}
109 \usepackage{lstlanghaskell}
110 \usepackage{lstlanghaskelllhstex}
111 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=]|#1|}
112 \newcommand{\haskellinline}[1]{\lstinline[language=Haskell,style=haskell,postbreak=]|#1|}
113 \newcommand{\haskelllhstexinline}[1]{\lstinline[language=Haskell,style=haskelllhstex,postbreak=]|#1|}
114 % Fix list of listings title
115 \renewcommand{\lstlistlistingname}{List of Listings}
116 % Fix list of listings chapter separator
117 \makeatletter
118 \let\my@chapter\@chapter%
119 \renewcommand*{\@chapter}{%
120 \addtocontents{lol}{\protect\addvspace{10pt}}%
121 \my@chapter}
122 \makeatother
123
124 \lstnewenvironment{lstClean}[1][]
125 {%
126 \lstset{language=Clean, #1}
127 \renewcommand*{\lstlistingname}{Listing (Clean)}
128 }
129 {}
130 \lstnewenvironment{lstHaskell}[1][]
131 {%
132 \lstset{language=Haskell,style=haskell,#1}%
133 \renewcommand*{\lstlistingname}{Listing (Haskell)}
134 }
135 {}
136 \lstnewenvironment{lstHaskellLhstex}[1][]
137 {%
138 \lstset{language=Haskell,style=haskelllhstex,#1}%
139 \renewcommand*{\lstlistingname}{Listing (Haskell)}
140 }
141 {}
142
143 % Glossaries and acronyms
144 \usepackage[acronym,nonumberlist]{glossaries}
145 % Fix gls in hyperlink errors
146 \pdfstringdefDisableCommands{%
147 \def\acrlong#1{}%
148 \def\acrlongpl#1{}%
149 \def\acrshort#1{}%
150 \def\acrshortpl#1{}%
151 \def\acrfull#1{}%
152 \def\acrfullpl#1{}%
153 \def\Acrlong#1{}%
154 \def\Acrlongpl#1{}%
155 \def\Acrshort#1{}%
156 \def\Acrshortpl#1{}%
157 \def\Acrfull#1{}%
158 \def\Acrfullpl#1{}%
159 \def\gls#1{}%
160 \def\glspl#1{}%
161 \def\glsentrytext#1{}%
162 \def\Gls#1{}%
163 \def\Glspl#1{}%
164 \def\Glsentrytext#1{}%
165 \def\titlecap#1{}%
166 }
167
168 % Titlecase commands
169 \usepackage{titlecaps}
170 \Addlcwords{of}
171 % Titlecase glossary command
172 \newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}}
173 \newcommand{\Glst}[1]{\glst{#1}}
174
175 % Pseudocode
176 \usepackage[algochapter]{algorithm2e}
177 % Fix the algorithm font
178 \renewcommand\AlCapFnt{\normalfont}
179
180 % Index
181 \usepackage{makeidx}
182 % Enable the index
183 \makeindex%
184
185 % Custom enumerations
186 \usepackage[inline,shortlabels]{enumitem}
187 \setlist{noitemsep}
188 \setlist[description]{leftmargin=\parindent}
189
190 % Epigraph
191 \usepackage{epigraph}
192
193 % Thumb marks on the page
194 \usepackage[
195 height={1.5cm},
196 width={12mm},
197 distance={1.55cm},
198 topthumbmargin={auto},
199 bottomthumbmargin={auto},
200 eventxtindent={.5cm},
201 oddtxtexdent={.3cm}]{thumbs}
202
203 % Custom headers and footers
204 \usepackage{fancyhdr}
205 %\pagestyle{fancy}
206 \pagestyle{headings}
207
208 % Tables spanning pages
209 \usepackage{longtable}
210
211 % Easy references
212 \usepackage{cleveref}
213
214 % To patch the chapter command
215 \usepackage{etoolbox}
216 % Have better page numbering in chapters
217 \patchcmd{\chapter}{plain}{headings}{}{}
218
219 % Increase the depth for the table of contents
220 \setcounter{secnumdepth}{3}
221 \renewcommand{\contentsname}{Table of Contents} % change the name of the TOC
222 \AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} % to remove page numbering from the TOC
223
224 % Initialize the glossaries
225 \makeglossaries%
226 \input{glossaries}
227
228 % Custom commands
229 \newcommand{\GHCmod}[1]{\texttt{#1}}
230 \newcommand{\requiresGHCmod}[1]{\footnote{Requires \GHCmod{#1} to be enabled.}}
231 \newcommand{\etc}{{\fontfamily{cmr}\selectfont{\itshape\/\&c}}}
232 \newcommand{\rdmentry}[6]{#1: #2 (#3): #4. #5.\ \href{https://doi.org/#6}{#6}}
233 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)}
234 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)}
235 \newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)}
236
237 \bibliographystyle{alpha}
238
239 \usepackage{subfiles}