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}}
121 %\newenvironment{chapterabstract}{\begin{quotation}\em\noindent}{\end{quotation}} %chktex 6
122 \definecolor{lstbg
}{gray
}{.95}
123 \definecolor{shadecolor
}{named
}{lstbg
}
124 \newenvironment{chapterabstract
}{\begin{shaded
}\em\noindent}{\end{shaded
}} %chktex 6
126 % Increase the depth for the table of contents
127 \setcounter{secnumdepth
}{3}
128 \renewcommand{\contentsname}{Table of Contents
} % change the name of the TOC
129 \AtBeginDocument{\addtocontents{toc
}{\protect\thispagestyle{empty
}}} % to remove page numbering from the TOC
132 \usepackage[subpreambles=true
]{standalone
} % standalone figures
133 %\usepackage{morewrites} % fix no more room for a new \write
134 \usepackage{appendix
} % subappendices, appendices per chapter
137 \usepackage{natbib
} % Cite bib entry completely
138 \setlength{\bibsep}{0.0pt
}
140 %\bibliographystyle{alpha}
141 \bibliographystyle{abbrvnat
}
142 \apptocmd{\thebibliography}{\raggedright}{}{}
143 \usepackage{bibentry
} % Cite bib entry completely
145 \newcommand{\citeentry}[1]{\begin{NoHyper
}\bibentry{#1}\end{NoHyper
}.
\citep{#1}}
148 \newcommand{\citepage}[1]{p.~
#1}
149 \newcommand{\citepages}[1]{pp.~
#1}
150 \newcommand{\citechapter}[1]{\cref@chapter@name~
#1}
151 \newcommand{\citechapters}[1]{\cref@chapter@name@plural~
#1}
152 \newcommand{\citesection}[1]{\cref@section@name~
#1}
153 \newcommand{\citesections}[1]{\cref@section@name@plural~
#1}
154 %\newcommand{\citesection}[1]{\S.~#1}
155 %\newcommand{\citesections}[1]{\S\S.~#1}
156 \newcommand{\citeparagraph}[1]{\P.~
#1}
157 \newcommand{\citeparagraphs}[1]{\P\P.~
#1}
161 \usepackage{graphicx} % Images
162 \graphicspath{{img/
},
{intro/img
},
{top/img
},
{tvt/img
}}
163 \usepackage{caption
} % subfigures/captionof
164 \usepackage{subcaption
}
165 \usepackage{rotating
}
166 \newcommand{\orcid}[1]{\href{https://orcid.org/
#1}{\hspace{1mm
}\includegraphics[width=
1em
]{orcid
}\hspace{2mm
} https://orcid.org/
#1}}
170 \usepackage{booktabs
} % Nicer tables
171 \usepackage{multirow
} % Multirow cells
172 \usepackage{tabularx
} % Automatically wrapping tables
173 \usepackage{longtable
} % Tables spanning pages
174 \usepackage{threeparttable
} % Tables with footnotes
178 \usepackage[algochapter,linesnumbered,lined,boxed
]{algorithm2e
}
179 % Fix the algorithm font
180 \renewcommand\AlCapFnt{\normalfont}
181 \usepackage{listings
}
182 % https://tex.stackexchange.com/questions/149056/how-can-i-define-additional-literate-replacements-without-deleting-existing-ones
184 \def\addToLiterate#1{\edef\lst@literate
{\unexpanded\expandafter{\lst@literate
}\unexpanded{#1}}}
185 \lst@Key
{moreliterate
}{}{\addToLiterate{#1}}
187 % General listings settings
190 basicstyle=
\tt\small,
191 breakatwhitespace=false,
196 escapeinside=
{[+
}{+
]},
% chktex 9
198 backgroundcolor=
\color{lstbg
},
201 postbreak=
\mbox{\textcolor{gray
}{$
\hookrightarrow$
}\space},
203 showstringspaces=false,
210 \usepackage{lstlangclean
}
211 \usepackage{lstlanghaskell
}
212 \usepackage{lstlangarduino
}
220 \newcommand{\cinline}[1]{\lstinline[language=c,postbreak=
]|
#1|
}
221 \newcommand{\arduinoinline}[1]{\lstinline[language=
{[Arduino
]C++
},postbreak=
]|
#1|
}
222 \newcommand{\pythoninline}[1]{\lstinline[language=Python,postbreak=
]|
#1|
}
223 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=
]|
#1|
}
224 \newcommand{\cleaninputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}\lstinputlisting[escapeinside=
{/*
}{*/
},language=Clean,
#1]{\subfix{#2}}}
225 \newcommand{\haskellinline}[1]{\lstinline[language=
{[Regular
]Haskell
},postbreak=
]|
#1|
}
226 \newcommand{\haskellinputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}\lstinputlisting[language=
{[Regular
]Haskell
},
#1]{\subfix{#2}}}
227 \newcommand{\haskelllhstexinline}[1]{\lstinline[language=
{[Lhs2Tex
]Haskell
},postbreak=
]|
#1|
}
228 %For storing listings in footnotes
230 % Fix list of listings title
231 \renewcommand{\lstlistlistingname}{List of Listings
}
232 % Fix list of listings chapter separator
234 \let\my@chapter\@chapter
%
235 \renewcommand*
{\@chapter
}{%
236 \addtocontents{lol
}{\protect\addvspace{10pt
}}%
240 \lstnewenvironment{lstPython
}[1][]
242 \lstset{language=Python,
#1}
243 \renewcommand*
{\lstlistingname}{Listing (
\gls{PYTHON
})
}
246 \lstnewenvironment{lstClean
}[1][]
248 \lstset{language=Clean,
#1}
249 \renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}
252 \lstnewenvironment{lstArduino
}[1][]
254 \lstset{language=
{[Arduino
]C++
},
#1}
255 \renewcommand*
{\lstlistingname}{Listing (
\gls{CPP
})
}
258 \lstnewenvironment{lstHaskell
}[1][]
260 \lstset{language=
{[Regular
]Haskell
},
#1}%
261 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
264 \lstnewenvironment{lstHaskellLhstex
}[1][]
266 \lstset{language=
{[Lhs2Tex
]Haskell
},
#1}%
267 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
271 % Hyperlinks and metadata
272 \usepackage[hyphens
]{url
}
273 \usepackage[pdflang=
{en-GB
},pagebackref,breaklinks
]{hyperref
} % hyperlinks
274 \usepackage{xr
} % hyperlinks
275 \renewcommand*
{\backref}[1]{}
276 \renewcommand*
{\backrefalt}[4]{[{%
277 \ifcase #1 not cited.
\or p.~
#2.
\else pp.
#2.
\fi%chktex 1
281 pdfauthor=
{\myauthor},
282 pdfkeywords=
{task-oriented programming, functional programming, domain specific languages, internet of things
},
285 \usepackage[nodayofweek
]{datetime
} % Use a fixed document date
287 \usepackage{bookmark
}
288 \usepackage[noabbrev
]{cleveref
} % Easy references
289 \usepackage{crossreftools
} % Easy references
290 \crefname{equ
}{equation
}{equations
}
291 \crefname{part
}{episode
}{episodes
}
292 \crefname{lstlisting
}{listing
}{listings
}
293 \crefname{equ
}{definition
}{definition
}
294 \usepackage{nameref
} % to reference names of chapters
295 \newcommand{\fullref}[1]{\crtcref{#1}:
\nameref{#1}}
296 \newcommand{\Fullref}[1]{\crtCref{#1}:
\nameref{#1}}
297 \creflabelformat{equation
}{#2\textup{#1}#3}
299 % Glossaries and acronyms
300 \usepackage[nolangwarn,abbreviations,nonumberlist,prefix
]{glossaries-extra
}
301 \setabbreviationstyle{long-short
}
302 \setabbreviationstyle[noexpand
]{short-nolong
}
304 \usepackage{glossary-mcols
}
305 \pdfstringdefDisableCommands{%
307 \def\glsxtrlongpl#1{}%
308 \def\glsxtrshort#1{}%
309 \def\glsxtrshortpl#1{}%
313 \def\Glsxtrlongpl#1{}%
314 \def\Glsxtrshort#1{}%
315 \def\Glsxtrshortpl#1{}%
320 \def\glsentrytext#1{}%
323 \def\Glsentrytext#1{}%
325 \def\MakeUppercase#1{}%
329 %\usepackage{makeidx}
330 %\makeindex% Enable the index
332 % Custom enumerations
333 \usepackage[inline,shortlabels
]{enumitem
}
335 \setlist[description
]{leftmargin=
\parindent}
337 % Initialize the glossaries
341 \usepackage{subfiles
}
343 \ifSubfilesClassLoaded{}{
345 \includexmp{CC_Attribution-NoDerivatives_4.0_International
}
349 \newcommand{\GHCmod}[1]{\texttt{#1}}
350 \newcommand{\aramsingh}{Ramsingh, A.\ (University of Glasgow)
}
351 \newcommand{\dcolon}[0]{\mathbin{::
}}
352 \newcommand{\doifmt}[1]{\href{https://doi.org/
#1}{#1}}
353 \newcommand{\etc}{{\fontfamily{cmr
}\selectfont{\itshape\/\&
\kern-
0.2em c
}}}
354 \newcommand{\jsinger}{Singer, dr.\ J.\ (University of Glasgow)
}
355 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)
}
356 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)
}
357 \newcommand{\ptrinder}{Trinder, prof.~dr.\ P.\ (University of Glasgow)
}
358 \newcommand{\rdmentry}[5]{#1 (
#2):
#3.
#4.\
\doifmt{#5}}
359 \newcommand{\rewriterate}[2]{\langle{}#1,
#2\rangle{}}
360 \newcommand{\requiresGHCmod}[2][]{\footnote{Requires
\GHCmod{#2} to be enabled.
#1}}
361 \newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)
}
362 \newcommand{\erasmusplus}{ERASMUS
\raisebox{.25ex
}{+
}}
363 \newcommand{\imtask}{\gls{ITASK
}\slash\gls{MTASK
}}
364 \newcommand{\Imtask}{\Gls{ITASK
}\slash\gls{MTASK
}}
365 \newcommand{\citask}{\gls{CLEAN
}\slash\gls{ITASK
}}
366 \newcommand{\Citask}{\Gls{CLEAN
}\slash\gls{ITASK
}}
367 \newcommand{\cimtask}{\gls{CLEAN
}\slash\gls{ITASK
}\slash\gls{MTASK
}}
368 \newcommand{\Cimtask}{\Gls{CLEAN
}\slash\gls{ITASK
}\slash\gls{MTASK
}}
369 \newcommand{\ccpp}{\gls{C
}\slash\gls{CPP
}}
370 \newcommand{\Ccpp}{\Gls{C
}\slash\gls{CPP
}}
371 \newcommand{\stacksize}[1]{\parallel#1\parallel}
374 \newenvironment{compilationscheme
}
375 {\allowdisplaybreaks\startalign}