4 \usepackage[utf8
]{inputenc} % Input encoding
5 \usepackage[T2A,
T1]{fontenc} % Font encoding
6 \usepackage{lmodern
} % Nicer font
7 \usepackage{microtype
} % Better kerning
8 \usepackage{tipa
} % IPA symbols
9 \usepackage{stmaryrd
} % short arrows
10 \usepackage{textcomp
} % upquote
11 \usepackage{titlecaps
} % titlecase commands
12 \usepackage{amsmath
} % extra math
13 \usepackage{amssymb
} % extra math symbols
14 \usepackage{wasysym
} % circle symbols
15 \usepackage{relsize
} % \smaller command
16 \usepackage{siunitx
} % typeset units
17 \usepackage{xcolor
} % colors
18 \usepackage{fnpct
} % footnotekerning
19 \DeclareSIUnit\noop{\relax}
20 \DeclareSIUnit\celcius{{}^
{\circ}\kern-
\scriptspace\mathsf{C
}}
22 \DeclareMathSymbol{\shortminus}{\mathbin}{AMSa
}{"
39} %chktex 18
24 % Internationalisation
25 \usepackage[dutch,russian,british
]{babel
}
27 %\babelfont[russian]{rm}{Liberation Serif}
29 % Papersize and layout
41 \usepackage{pdflscape
}
44 \DeclareFloatingEnvironment[
46 listname=
{List of definitions
},
52 \usepackage{fancyhdr
} % Custom headers and footers
57 \setlength{\unitlength}{18mm
}
58 \newcommand{\blob}{{\color{gray
}\rule[-
.2\unitlength]{2\unitlength}{.5\unitlength}}}
59 \fancyhead[RE
]{\rightmark}
60 \fancyhead[LO
]{\leftmark}
61 \newcommand{\frontmatterfancy}[0]{
62 \fancyhead[RO
]{\thepage}
63 \fancyhead[LE
]{\thepage}
65 \newcommand{\mainmatterfancy}[0]{
69 \put(
1,-
\value{chapter
})
{\blob}
74 \put(-
3,-
\value{chapter
})
{\blob}
79 \newcommand{\backmatterfancy}[0]{
93 \renewcommand{\chaptermark}[1]{\markboth{\chaptername\
\thechapter.\
#1}{}}
94 \renewcommand{\sectionmark}[1]{\markright{\thesection.\
#1}}
95 %\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername}\ \thechapter.\ #1}{}}
96 %\renewcommand{\headrulewidth}{0pt}
97 \renewcommand{\footrulewidth}{0pt
}
98 \usepackage{etoolbox
} % To patch the chapter command
99 % Have better page numbering in chapters
100 \patchcmd{\chapter}{plain
}{headings
}{}{}
101 \usepackage{epigraph
} % Epigraph
102 \renewcommand\partname{Episode
} % Rename parts to episodes (rhapsody uhu)
103 \addto\captionsbritish{\renewcommand{\partname}{Episode
}}
104 \usepackage{titlesec
}
105 \titleformat{\part}[block
]
107 {\partname~
\thepart:
}
110 % This is required to make \nameref work (https://tex.stackexchange.com/questions/211035/problems-with-nameref-not-refering-to-the-correct-label-x-titlesec)
112 \let\titlesec@part
\part%
113 \renewcommand{\part}{\@ifstar
\part@star
\part@nostar
}
114 \def\part@star
#1{\NR@gettitle
{#1}\titlesec@part*
{#1}}
115 \def\part@nostar
{\@ifnextchar
[\part@nostar@opt
\part@nostar@nopt
} % chktex 9
116 \def\part@nostar@nopt
#1{\NR@gettitle
{#1}\titlesec@part
{#1}}
117 \def\part@nostar@opt
[#1]#2{\NR@gettitle
{#1}\titlesec@part
[#1]{#2}}
119 \newenvironment{chapterabstract
}{\begin{quotation
}\em}{\end{quotation
}} %chktex 6
121 % Increase the depth for the table of contents
122 \setcounter{secnumdepth
}{3}
123 \renewcommand{\contentsname}{Table of Contents
} % change the name of the TOC
124 \AtBeginDocument{\addtocontents{toc
}{\protect\thispagestyle{empty
}}} % to remove page numbering from the TOC
127 \usepackage[subpreambles=true
]{standalone
} % standalone figures
128 %\usepackage{morewrites} % fix no more room for a new \write
129 \usepackage{appendix
} % subappendices, appendices per chapter
132 \usepackage{natbib
} % Cite bib entry completely
133 \setlength{\bibsep}{0.0pt
}
135 %\bibliographystyle{alpha}
136 \bibliographystyle{abbrvnat
}
137 \apptocmd{\thebibliography}{\raggedright}{}{}
138 \usepackage{bibentry
} % Cite bib entry completely
140 \newcommand{\citeentry}[1]{\begin{NoHyper
}\bibentry{#1}\end{NoHyper
}.
\citep{#1}}
143 \newcommand{\citepage}[1]{p.~
#1}
144 \newcommand{\citepages}[1]{pp.~
#1}
145 \newcommand{\citechapter}[1]{\cref@chapter@name~
#1}
146 \newcommand{\citechapters}[1]{\cref@chapter@name@plural~
#1}
147 \newcommand{\citesection}[1]{\cref@section@name~
#1}
148 \newcommand{\citesections}[1]{\cref@section@name@plural~
#1}
149 %\newcommand{\citesection}[1]{\S.~#1}
150 %\newcommand{\citesections}[1]{\S\S.~#1}
151 \newcommand{\citeparagraph}[1]{\P.~
#1}
152 \newcommand{\citeparagraphs}[1]{\P\P.~
#1}
156 \usepackage{graphicx} % Images
157 \graphicspath{{img/
},
{intro/img
},
{top/img
},
{tvt/img
}}
158 \usepackage{caption
} % subfigures
159 \usepackage{subcaption
}
160 \usepackage{rotating
}
161 \newcommand{\orcid}[1]{\href{https://orcid.org/
#1}{\hspace{1mm
}\includegraphics[width=
1em
]{orcid
}\hspace{2mm
} https://orcid.org/
#1}}
165 \usepackage{booktabs
} % Nicer tables
166 \usepackage{multirow
} % Multirow cells
167 \usepackage{tabularx
} % Automatically wrapping tables
168 \usepackage{longtable
} % Tables spanning pages
169 \usepackage{threeparttable
} % Tables with footnotes
173 \usepackage[algochapter,linesnumbered,lined,boxed
]{algorithm2e
}
174 % Fix the algorithm font
175 \renewcommand\AlCapFnt{\normalfont}
176 \usepackage{listings
}
177 % https://tex.stackexchange.com/questions/149056/how-can-i-define-additional-literate-replacements-without-deleting-existing-ones
179 \def\addToLiterate#1{\edef\lst@literate
{\unexpanded\expandafter{\lst@literate
}\unexpanded{#1}}}
180 \lst@Key
{moreliterate
}{}{\addToLiterate{#1}}
182 % General listings settings
185 basicstyle=
\tt\small,
186 breakatwhitespace=false,
191 escapeinside=
{[+
}{+
]},
% chktex 9
195 postbreak=
\mbox{\textcolor{gray
}{$
\hookrightarrow$
}\space},
197 showstringspaces=false,
204 \usepackage{lstlangclean
}
205 \usepackage{lstlanghaskell
}
206 \usepackage{lstlangarduino
}
214 \newcommand{\cinline}[1]{\lstinline[language=c,postbreak=
]|
#1|
}
215 \newcommand{\arduinoinline}[1]{\lstinline[language=
{[Arduino
]C++
},postbreak=
]|
#1|
}
216 \newcommand{\pythoninline}[1]{\lstinline[language=Python,postbreak=
]|
#1|
}
217 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=
]|
#1|
}
218 \newcommand{\cleaninputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}\lstinputlisting[language=Clean,
#1]{\subfix{#2}}}
219 \newcommand{\haskellinline}[1]{\lstinline[language=
{[Regular
]Haskell
},postbreak=
]|
#1|
}
220 \newcommand{\haskellinputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}\lstinputlisting[language=
{[Regular
]Haskell
},
#1]{\subfix{#2}}}
221 \newcommand{\haskelllhstexinline}[1]{\lstinline[language=
{[Lhs2Tex
]Haskell
},postbreak=
]|
#1|
}
222 %For storing listings in footnotes
224 % Fix list of listings title
225 \renewcommand{\lstlistlistingname}{List of Listings
}
226 % Fix list of listings chapter separator
228 \let\my@chapter\@chapter
%
229 \renewcommand*
{\@chapter
}{%
230 \addtocontents{lol
}{\protect\addvspace{10pt
}}%
234 \lstnewenvironment{lstPython
}[1][]
236 \lstset{language=Python,
#1}
237 \renewcommand*
{\lstlistingname}{Listing (
\gls{PYTHON
})
}
240 \lstnewenvironment{lstClean
}[1][]
242 \lstset{language=Clean,
#1}
243 \renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}
246 \lstnewenvironment{lstArduino
}[1][]
248 \lstset{language=
{[Arduino
]C++
},
#1}
249 \renewcommand*
{\lstlistingname}{Listing (
\gls{CPP
})
}
252 \lstnewenvironment{lstHaskell
}[1][]
254 \lstset{language=
{[Regular
]Haskell
},
#1}%
255 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
258 \lstnewenvironment{lstHaskellLhstex
}[1][]
260 \lstset{language=
{[Lhs2Tex
]Haskell
},
#1}%
261 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
265 % Hyperlinks and metadata
266 \usepackage[pdflang=
{en-GB
},pagebackref
]{hyperref
} % hyperlinks
267 \usepackage{xr
} % hyperlinks
268 \renewcommand*
{\backref}[1]{}
269 \renewcommand*
{\backrefalt}[4]{[{%
270 \ifcase #1 not cited.
\or p.~
#2.
\else pp.
#2.
\fi%chktex 1
274 pdfauthor=
{\myauthor},
275 pdfkeywords=
{task-oriented programming, functional programming, domain specific languages, internet of things
},
278 \usepackage[nodayofweek
]{datetime
} % Use a fixed document date
280 \usepackage{bookmark
}
281 \usepackage[noabbrev
]{cleveref
} % Easy references
282 \usepackage{crossreftools
} % Easy references
283 \crefname{equ
}{equation
}{equations
}
284 \crefname{part
}{episode
}{episodes
}
285 \crefname{lstlisting
}{listing
}{listings
}
286 \crefname{equ
}{definition
}{definition
}
287 \usepackage{nameref
} % to reference names of chapters
288 \newcommand{\fullref}[1]{\crtcref{#1}:
\nameref{#1}}
289 \newcommand{\Fullref}[1]{\crtCref{#1}:
\nameref{#1}}
290 \creflabelformat{equation
}{#2\textup{#1}#3}
292 % Glossaries and acronyms
293 \usepackage[nolangwarn,abbreviations,nonumberlist,prefix
]{glossaries-extra
}
294 \setabbreviationstyle{long-short
}
295 \setabbreviationstyle[noexpand
]{short-nolong
}
297 \usepackage{glossary-mcols
}
298 \pdfstringdefDisableCommands{%
300 \def\glsxtrlongpl#1{}%
301 \def\glsxtrshort#1{}%
302 \def\glsxtrshortpl#1{}%
306 \def\Glsxtrlongpl#1{}%
307 \def\Glsxtrshort#1{}%
308 \def\Glsxtrshortpl#1{}%
313 \def\glsentrytext#1{}%
316 \def\Glsentrytext#1{}%
318 \def\MakeUppercase#1{}%
322 %\usepackage{makeidx}
323 %\makeindex% Enable the index
325 % Custom enumerations
326 \usepackage[inline,shortlabels
]{enumitem
}
328 \setlist[description
]{leftmargin=
\parindent}
330 % Initialize the glossaries
334 \usepackage{subfiles
}
336 \ifSubfilesClassLoaded{}{
338 \includexmp{CC_Attribution-NoDerivatives_4.0_International
}
342 \newcommand{\GHCmod}[1]{\texttt{#1}}
343 \newcommand{\aramsingh}{Ramsingh, A.\ (University of Glasgow)
}
344 \newcommand{\dcolon}[0]{\mathbin{::
}}
345 \newcommand{\doifmt}[1]{\href{https://doi.org/
#1}{#1}}
346 \newcommand{\etc}{{\fontfamily{cmr
}\selectfont{\itshape\/\&
\kern-
0.2em c
}}}
347 \newcommand{\jsinger}{Singer, dr.\ J.\ (University of Glasgow)
}
348 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)
}
349 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)
}
350 \newcommand{\ptrinder}{Trinder, prof.~dr.\ P.\ (University of Glasgow)
}
351 \newcommand{\rdmentry}[5]{#1 (
#2):
#3.
#4.\
\doifmt{#5}}
352 \newcommand{\rewriterate}[2]{\langle{}#1,
#2\rangle{}}
353 \newcommand{\requiresGHCmod}[2][]{\footnote{Requires
\GHCmod{#2} to be enabled.
#1}}
354 \newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)
}
355 \newcommand{\erasmusplus}{ERASMUS
\raisebox{.25ex
}{+
}}