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
}
43 \usepackage{fancyhdr
} % Custom headers and footers
48 \setlength{\unitlength}{18mm
}
49 \newcommand{\blob}{{\color{gray
}\rule[-
.2\unitlength]{2\unitlength}{.5\unitlength}}}
50 \fancyhead[RE
]{\rightmark}
51 \fancyhead[LO
]{\leftmark}
52 \newcommand{\frontmatterfancy}[0]{
53 \fancyhead[RO
]{\thepage}
54 \fancyhead[LE
]{\thepage}
56 \newcommand{\mainmatterfancy}[0]{
60 \put(
1,-
\value{chapter
})
{\blob}
65 \put(-
3,-
\value{chapter
})
{\blob}
70 \newcommand{\backmatterfancy}[0]{
84 \renewcommand{\chaptermark}[1]{\markboth{\chaptername\
\thechapter.\
#1}{}}
85 \renewcommand{\sectionmark}[1]{\markright{\thesection.\
#1}}
86 %\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername}\ \thechapter.\ #1}{}}
87 %\renewcommand{\headrulewidth}{0pt}
88 \renewcommand{\footrulewidth}{0pt
}
89 \usepackage{etoolbox
} % To patch the chapter command
90 % Have better page numbering in chapters
91 \patchcmd{\chapter}{plain
}{headings
}{}{}
92 \usepackage{epigraph
} % Epigraph
93 \renewcommand\partname{Episode
} % Rename parts to episodes (rhapsody uhu)
94 \addto\captionsbritish{\renewcommand{\partname}{Episode
}}
96 \titleformat{\part}[block
]
101 % This is required to make \nameref work (https://tex.stackexchange.com/questions/211035/problems-with-nameref-not-refering-to-the-correct-label-x-titlesec)
103 \let\titlesec@part
\part%
104 \renewcommand{\part}{\@ifstar
\part@star
\part@nostar
}
105 \def\part@star
#1{\NR@gettitle
{#1}\titlesec@part*
{#1}}
106 \def\part@nostar
{\@ifnextchar
[\part@nostar@opt
\part@nostar@nopt
} % chktex 9
107 \def\part@nostar@nopt
#1{\NR@gettitle
{#1}\titlesec@part
{#1}}
108 \def\part@nostar@opt
[#1]#2{\NR@gettitle
{#1}\titlesec@part
[#1]{#2}}
110 \newenvironment{chapterabstract
}{\begin{quotation
}\em}{\end{quotation
}} %chktex 6
112 % Increase the depth for the table of contents
113 \setcounter{secnumdepth
}{3}
114 \renewcommand{\contentsname}{Table of Contents
} % change the name of the TOC
115 \AtBeginDocument{\addtocontents{toc
}{\protect\thispagestyle{empty
}}} % to remove page numbering from the TOC
118 \usepackage[subpreambles=true
]{standalone
} % standalone figures
119 %\usepackage{morewrites} % fix no more room for a new \write
120 \usepackage{appendix
} % subappendices, appendices per chapter
123 \usepackage{natbib
} % Cite bib entry completely
124 \setlength{\bibsep}{0.0pt
}
126 %\bibliographystyle{alpha}
127 \bibliographystyle{abbrvnat
}
128 \apptocmd{\thebibliography}{\raggedright}{}{}
129 \usepackage{bibentry
} % Cite bib entry completely
131 \newcommand{\citeentry}[1]{\begin{NoHyper
}\bibentry{#1}\end{NoHyper
}.
\citep{#1}}
134 \newcommand{\citepage}[1]{p.~
#1}
135 \newcommand{\citepages}[1]{pp.~
#1}
136 \newcommand{\citechapter}[1]{\cref@chapter@name~
#1}
137 \newcommand{\citechapters}[1]{\cref@chapter@name@plural~
#1}
138 \newcommand{\citesection}[1]{\cref@section@name~
#1}
139 \newcommand{\citesections}[1]{\cref@section@name@plural~
#1}
140 %\newcommand{\citesection}[1]{\S.~#1}
141 %\newcommand{\citesections}[1]{\S\S.~#1}
142 \newcommand{\citeparagraph}[1]{\P.~
#1}
143 \newcommand{\citeparagraphs}[1]{\P\P.~
#1}
147 \usepackage{graphicx} % Images
148 \graphicspath{{img/
},
{intro/img
},
{top/img
},
{tvt/img
}}
149 \usepackage{caption
} % subfigures
150 \usepackage{subcaption
}
151 \usepackage{rotating
}
152 \newcommand{\orcid}[1]{\href{https://orcid.org/
#1}{\hspace{1mm
}\includegraphics[width=
1em
]{orcid
}\hspace{2mm
} https://orcid.org/
#1}}
156 \usepackage{booktabs
} % Nicer tables
157 \usepackage{multirow
} % Multirow cells
158 \usepackage{tabularx
} % Automatically wrapping tables
159 \usepackage{longtable
} % Tables spanning pages
160 \usepackage{threeparttable
} % Tables with footnotes
164 \usepackage[algochapter,linesnumbered,lined,boxed
]{algorithm2e
}
165 % Fix the algorithm font
166 \renewcommand\AlCapFnt{\normalfont}
167 \usepackage{listings
}
168 % https://tex.stackexchange.com/questions/149056/how-can-i-define-additional-literate-replacements-without-deleting-existing-ones
170 \def\addToLiterate#1{\edef\lst@literate
{\unexpanded\expandafter{\lst@literate
}\unexpanded{#1}}}
171 \lst@Key
{moreliterate
}{}{\addToLiterate{#1}}
173 % General listings settings
176 basicstyle=
\tt\small,
177 breakatwhitespace=false,
182 escapeinside=
{[+
}{+
]},
% chktex 9
186 postbreak=
\mbox{\textcolor{gray
}{$
\hookrightarrow$
}\space},
188 showstringspaces=false,
195 \usepackage{lstlangclean
}
196 \usepackage{lstlanghaskell
}
197 \usepackage{lstlangarduino
}
205 \newcommand{\cinline}[1]{\lstinline[language=c,postbreak=
]|
#1|
}
206 \newcommand{\arduinoinline}[1]{\lstinline[language=
{[Arduino
]C++
},postbreak=
]|
#1|
}
207 \newcommand{\pythoninline}[1]{\lstinline[language=Python,postbreak=
]|
#1|
}
208 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=
]|
#1|
}
209 \newcommand{\cleaninputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}\lstinputlisting[language=Clean,
#1]{#2}}
210 \newcommand{\haskellinline}[1]{\lstinline[language=
{[Regular
]Haskell
},postbreak=
]|
#1|
}
211 \newcommand{\haskellinputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}\lstinputlisting[language=
{[Regular
]Haskell
},
#1]{#2}}
212 \newcommand{\haskelllhstexinline}[1]{\lstinline[language=
{[Lhs2Tex
]Haskell
},postbreak=
]|
#1|
}
213 %For storing listings in footnotes
215 % Fix list of listings title
216 \renewcommand{\lstlistlistingname}{List of Listings
}
217 % Fix list of listings chapter separator
219 \let\my@chapter\@chapter
%
220 \renewcommand*
{\@chapter
}{%
221 \addtocontents{lol
}{\protect\addvspace{10pt
}}%
225 \lstnewenvironment{lstPython
}[1][]
227 \lstset{language=Python,
#1}
228 \renewcommand*
{\lstlistingname}{Listing (
\gls{PYTHON
})
}
231 \lstnewenvironment{lstClean
}[1][]
233 \lstset{language=Clean,
#1}
234 \renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}
237 \lstnewenvironment{lstArduino
}[1][]
239 \lstset{language=
{[Arduino
]C++
},
#1}
240 \renewcommand*
{\lstlistingname}{Listing (
\gls{CPP
})
}
243 \lstnewenvironment{lstHaskell
}[1][]
245 \lstset{language=
{[Regular
]Haskell
},
#1}%
246 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
249 \lstnewenvironment{lstHaskellLhstex
}[1][]
251 \lstset{language=
{[Lhs2Tex
]Haskell
},
#1}%
252 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
256 % Hyperlinks and metadata
257 \usepackage[pdflang=
{en-GB
},pagebackref
]{hyperref
} % hyperlinks
258 \usepackage{xr
} % hyperlinks
259 \renewcommand*
{\backref}[1]{}
260 \renewcommand*
{\backrefalt}[4]{[{%
261 \ifcase #1 not cited.
\or p.~
#2.
\else pp.
#2.
\fi%chktex 1
265 pdfauthor=
{\myauthor},
266 pdfkeywords=
{task-oriented programming, functional programming, domain specific languages, internet of things
},
269 \usepackage[nodayofweek
]{datetime
} % Use a fixed document date
271 \usepackage{bookmark
}
272 \usepackage[noabbrev
]{cleveref
} % Easy references
273 \crefname{part
}{episode
}{episodes
}
274 \crefname{lstlisting
}{listing
}{listings
}
275 \usepackage{nameref
} % to reference names of chapters
276 \newcommand{\fullref}[1]{\cref{#1}:
\nameref{#1}}
277 \newcommand{\Fullref}[1]{\Cref{#1}:
\nameref{#1}}
278 \creflabelformat{equation
}{#2\textup{#1}#3}
280 % Glossaries and acronyms
281 \usepackage[nolangwarn,abbreviations,nonumberlist,prefix
]{glossaries-extra
}
282 \setabbreviationstyle[acronym
]{long-short
}
284 % Titlecase glossary commands
285 \newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}}
286 \newcommand{\Glst}[1]{\glst{#1}}
287 \usepackage{glossary-mcols
}
288 \pdfstringdefDisableCommands{%
290 \def\glsxtrlongpl#1{}%
291 \def\glsxtrshort#1{}%
292 \def\glsxtrshortpl#1{}%
296 \def\Glsxtrlongpl#1{}%
297 \def\Glsxtrshort#1{}%
298 \def\Glsxtrshortpl#1{}%
303 \def\glsentrytext#1{}%
306 \def\Glsentrytext#1{}%
311 %\usepackage{makeidx}
312 %\makeindex% Enable the index
314 % Custom enumerations
315 \usepackage[inline,shortlabels
]{enumitem
}
317 \setlist[description
]{leftmargin=
\parindent}
319 % Initialize the glossaries
323 \usepackage{subfiles
}
325 \ifSubfilesClassLoaded{}{
327 \includexmp{CC_Attribution-NoDerivatives_4.0_International
}
331 \newcommand{\GHCmod}[1]{\texttt{#1}}
332 \newcommand{\aramsingh}{Ramsingh, A.\ (University of Glasgow)
}
333 \newcommand{\dcolon}[0]{\mathbin{::
}}
334 \newcommand{\doifmt}[1]{\href{https://doi.org/
#1}{#1}}
335 \newcommand{\etc}{{\fontfamily{cmr
}\selectfont{\itshape\/\&
\kern-
0.2em c
}}}
336 \newcommand{\jsinger}{Singer, dr.\ J.\ (University of Glasgow)
}
337 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)
}
338 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)
}
339 \newcommand{\ptrinder}{Trinder, prof.~dr.\ P.\ (University of Glasgow)
}
340 \newcommand{\rdmentry}[5]{#1 (
#2):
#3.
#4.\
\doifmt{#5}}
341 \newcommand{\refreshrate}[2]{\langle{}#1,
#2\rangle{}}
342 \newcommand{\requiresGHCmod}[2][]{\footnote{Requires
\GHCmod{#2} to be enabled.
#1}}
343 \newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)
}
344 \newcommand{\erasmusplus}{ERASMUS
\raisebox{.25ex
}{+
}}