add license
[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
34 % TODO is this necessary?
35 %\usepackage[titletoc]{appendix}
36
37 % Hyperlinks
38 %\usepackage[pagebackref]{hyperref}
39 \usepackage[pagebackref]{hyperref}
40 % Setup pdf parameters: TODO
41 \hypersetup{%
42 pdftitle={\mytitle},
43 pdfauthor={\myauthor},
44 pdfsubject={},
45 % pdfcreator={},
46 % pdfproducer={},
47 pdfkeywords={task-oriented programming, functional programming, domain specific languages, internet of things},
48 hidelinks,
49 }
50 \urlstyle{same}
51 \usepackage{xmpincl}
52 \includexmp{CC_Attribution-NoDerivatives_4.0_International}
53
54 % Graphics
55 \usepackage{graphicx}
56 % Images directory
57 \graphicspath{{img/}}
58 %subfigures
59 \usepackage{caption}
60 \usepackage{subcaption}
61
62 % Nice tables
63 \usepackage{booktabs}
64
65 % Automatically wrapping tables
66 \usepackage{tabularx}
67
68 % Use a fixed document date
69 \usepackage[nodayofweek]{datetime}
70
71 % Code
72 \usepackage{stmaryrd} % Short arrow
73 \usepackage{listings}
74 % General listings settings
75 \lstset{%
76 basewidth=0.45em,
77 basicstyle=\linespread{0.9}\tt\footnotesize,
78 breakatwhitespace=false,
79 breaklines=true,
80 captionpos=b,
81 columns=[c]fixed,
82 commentstyle=\sl,
83 escapeinside={(+}{+)}, % chktex 9
84 frame=L,
85 keepspaces=true,
86 keywordstyle=\bf,
87 postbreak=\mbox{\textcolor{gray}{$\hookrightarrow$}\space},
88 showspaces=false,
89 showstringspaces=false,
90 showtabs=false,
91 stringstyle=\it,
92 tabsize=4,
93 % literate=%
94 % {a0}{{a\textsubscript{0}}}2
95 % {a1}{{a\textsubscript{1}}}2
96 % {a2}{{a\textsubscript{2}}}2
97 %% {an}{{a\textsubscript{n}}}2
98 % {c0}{{c\textsubscript{0}}}2
99 % {c1}{{c\textsubscript{1}}}2
100 % {c2}{{c\textsubscript{2}}}2
101 % {cn}{{c\textsubscript{n}}}2
102 % {f0}{{f\textsubscript{0}}}2
103 % {f1}{{f\textsubscript{1}}}2
104 % {f2}{{f\textsubscript{2}}}2
105 % {fn}{{f\textsubscript{n}}}2
106 % {t0}{{t\textsubscript{0}}}2
107 % {t1}{{t\textsubscript{1}}}2
108 % {t2}{{t\textsubscript{2}}}2
109 % {tn}{{t\textsubscript{n}}}2
110 % {v0}{{v\textsubscript{0}}}2
111 % {v1}{{v\textsubscript{1}}}2
112 % {v2}{{v\textsubscript{2}}}2
113 % {vn}{{v\textsubscript{n}}}2
114 % {C0}{{C\textsubscript{0}}}2
115 % {C1}{{C\textsubscript{1}}}2
116 % {C2}{{C\textsubscript{2}}}2
117 % {Cn}{{C\textsubscript{n}}}2
118 % {R0}{{R\textsubscript{0}}}2
119 % {R1}{{R\textsubscript{1}}}2
120 % {R2}{{R\textsubscript{2}}}2
121 % {Rn}{{R\textsubscript{n}}}2
122 }
123 \usepackage{lstlangclean}
124 \usepackage{lstlanghaskell}
125 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=]|#1|}
126 \newcommand{\haskellinline}[1]{\lstinline[language=Haskell,style=haskell,postbreak=]|#1|}
127 % Fix list of listings title
128 \renewcommand{\lstlistlistingname}{List of Listings}
129 % Fix list of listings chapter separator
130 \makeatletter
131 \let\my@chapter\@chapter%
132 \renewcommand*{\@chapter}{%
133 \addtocontents{lol}{\protect\addvspace{10pt}}%
134 \my@chapter}
135 \makeatother
136
137 \lstnewenvironment{lstClean}[1][]
138 {%
139 \lstset{language=Clean, #1}
140 \renewcommand*{\lstlistingname}{Listing (Clean)}
141 }
142 {}
143 \lstnewenvironment{lstHaskell}[1][]
144 {%
145 \lstset{language=Haskell,style=haskell,#1}%
146 \renewcommand*{\lstlistingname}{Listing (Haskell)}
147 }
148 {}
149
150 % Glossaries and acronyms
151 \usepackage[acronym,nonumberlist]{glossaries}
152 % Fix gls in hyperlink errors
153 \pdfstringdefDisableCommands{%
154 \def\acrlong#1{}%
155 \def\acrlongpl#1{}%
156 \def\acrshort#1{}%
157 \def\acrshortpl#1{}%
158 \def\acrfull#1{}%
159 \def\acrfullpl#1{}%
160 \def\Acrlong#1{}%
161 \def\Acrlongpl#1{}%
162 \def\Acrshort#1{}%
163 \def\Acrshortpl#1{}%
164 \def\Acrfull#1{}%
165 \def\Acrfullpl#1{}%
166 \def\gls#1{}%
167 \def\glspl#1{}%
168 \def\glsentrytext#1{}%
169 \def\Gls#1{}%
170 \def\Glspl#1{}%
171 \def\Glsentrytext#1{}%
172 \def\titlecap#1{}%
173 }
174
175 % Titlecase commands
176 \usepackage{titlecaps}
177 \Addlcwords{of}
178 % Titlecase glossary command
179 \newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}}
180 \newcommand{\Glst}[1]{\glst{#1}}
181
182 % Pseudocode
183 \usepackage[algochapter]{algorithm2e}
184 % Fix the algorithm font
185 \renewcommand\AlCapFnt{\normalfont}
186
187 % Index
188 \usepackage{makeidx}
189 % Enable the index
190 \makeindex%
191
192 % Custom enumerations
193 \usepackage[inline,shortlabels]{enumitem}
194 \setlist{noitemsep}
195 \setlist[description]{leftmargin=\parindent}
196
197 % Epigraph
198 \usepackage{epigraph}
199
200 % Thumb marks on the page
201 \usepackage[
202 height={1.5cm},
203 width={12mm},
204 distance={1.55cm},
205 topthumbmargin={auto},
206 bottomthumbmargin={auto},
207 eventxtindent={.5cm},
208 oddtxtexdent={.3cm}]{thumbs}
209
210 % Custom headers and footers
211 \usepackage{fancyhdr}
212 \pagestyle{fancy}
213
214 % Tables spanning pages
215 \usepackage{longtable}
216
217 % Easy references
218 \usepackage{cleveref}
219
220 % To patch the chapter command
221 \usepackage{etoolbox}
222 % Have better page numbering in chapters
223 \patchcmd{\chapter}{plain}{headings}{}{}
224
225 % Increase the depth for the table of contents
226 \setcounter{secnumdepth}{3}
227 \renewcommand{\contentsname}{Table of Contents} % change the name of the TOC
228 \AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} % to remove page numbering from the TOC
229
230 % Initialize the glossaries
231 \makeglossaries%
232 \input{glossaries}
233
234 % Custom commands
235 \newcommand{\GHCmod}[1]{\texttt{#1}}
236 \newcommand{\requiresGHCmod}[1]{\footnote{Requires \GHCmod{#1} to be enabled.}}
237 \newcommand{\etc}{{\fontfamily{cmr}\selectfont{\itshape\/\&c}}}
238 \newcommand{\rdmentry}[6]{#1: #2 (#3): #4. #5.\ \href{https://doi.org/#6}{#6}}
239 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)}
240 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)}
241 \newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)}
242
243 \bibliographystyle{alpha}
244
245 \usepackage{subfiles}