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