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 \usepackage[all
]{nowidow
} % Kill widows and orphans
20 \DeclareSIUnit\noop{\relax}
21 \DeclareSIUnit\celcius{{}^
{\circ}\kern-
\scriptspace\mathsf{C
}}
23 \DeclareMathSymbol{\shortminus}{\mathbin}{AMSa
}{"
39} %chktex 18
25 % Internationalisation
26 \usepackage[dutch,russian,british
]{babel
}
28 %\babelfont[russian]{rm}{Liberation Serif}
30 % Papersize and layout
42 \usepackage{pdflscape
}
45 \DeclareFloatingEnvironment[
47 listname=
{List of definitions
},
53 \usepackage{fancyhdr
} % Custom headers and footers
54 \usepackage[fit
]{truncate
}
59 \setlength{\unitlength}{18mm
}
60 \newcommand{\blob}{{\color{gray
}\rule[-
.2\unitlength]{2\unitlength}{.5\unitlength}}}
61 \fancyhead[RE
]{\truncate{.95\headwidth}{\rightmark}}
62 \fancyhead[LO
]{\truncate{.95\headwidth}{\leftmark}}
63 \newcommand{\frontmatterfancy}[0]{
64 \fancyhead[RO
]{\thepage}
65 \fancyhead[LE
]{\thepage}
67 \newcommand{\mainmatterfancy}[0]{
71 \put(
1,-
\value{chapter
})
{\blob}
76 \put(-
3,-
\value{chapter
})
{\blob}
81 \newcommand{\backmatterfancy}[0]{
95 \renewcommand{\chaptermark}[1]{\markboth{\chaptername\
\thechapter.\
#1}{}}
96 \renewcommand{\sectionmark}[1]{\markright{\thesection.\
#1}}
97 %\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername}\ \thechapter.\ #1}{}}
98 %\renewcommand{\headrulewidth}{0pt}
99 \renewcommand{\footrulewidth}{0pt
}
100 \usepackage{etoolbox
} % To patch the chapter command
101 % Have better page numbering in chapters
102 \patchcmd{\chapter}{plain
}{headings
}{}{}
103 \usepackage{epigraph
} % Epigraph
104 \renewcommand\partname{Episode
} % Rename parts to episodes (rhapsody uhu)
105 \addto\captionsbritish{\renewcommand{\partname}{Episode
}}
106 \usepackage{titlesec
}
107 \titleformat{\part}[block
]
109 {\partname~
\thepart:
}
112 % This is required to make \nameref work (https://tex.stackexchange.com/questions/211035/problems-with-nameref-not-refering-to-the-correct-label-x-titlesec)
114 \let\titlesec@part
\part%
115 \renewcommand{\part}{\@ifstar
\part@star
\part@nostar
}
116 \def\part@star
#1{\NR@gettitle
{#1}\titlesec@part*
{#1}}
117 \def\part@nostar
{\@ifnextchar
[\part@nostar@opt
\part@nostar@nopt
} % chktex 9
118 \def\part@nostar@nopt
#1{\NR@gettitle
{#1}\titlesec@part
{#1}}
119 \def\part@nostar@opt
[#1]#2{\NR@gettitle
{#1}\titlesec@part
[#1]{#2}}
123 \definecolor{lstbg
}{gray
}{.95}
124 \definecolor{shadecolor
}{named
}{lstbg
}
125 \newenvironment{chapterabstract
}{\begin{shaded
}\begin{quotation
}}{\end{quotation
}\end{shaded
}} %chktex 6
127 % Increase the depth for the table of contents
128 \setcounter{secnumdepth
}{3}
129 \renewcommand{\contentsname}{Table of Contents
} % change the name of the TOC
130 \AtBeginDocument{\addtocontents{toc
}{\protect\thispagestyle{empty
}}} % to remove page numbering from the TOC
133 \usepackage[subpreambles=true
]{standalone
} % standalone figures
134 %\usepackage{morewrites} % fix no more room for a new \write
135 \usepackage{appendix
} % subappendices, appendices per chapter
138 \usepackage{natbib
} % Cite bib entry completely
139 \setlength{\bibsep}{0.0pt
}
141 %\bibliographystyle{alpha}
142 \bibliographystyle{abbrvnat
}
143 \apptocmd{\thebibliography}{\raggedright}{}{}
144 \usepackage{bibentry
} % Cite bib entry completely
146 \newcommand{\citeentry}[1]{\begin{NoHyper
}\bibentry{#1}\end{NoHyper
}.
\citep{#1}}
147 \newcommand{\refurl}[2]{\url{#1}, accessed on:
#2}
150 \newcommand{\citepage}[1]{p.~
#1}
151 \newcommand{\citepages}[1]{pp.~
#1}
152 \newcommand{\citechapter}[1]{\cref@chapter@name~
#1}
153 \newcommand{\citechapters}[1]{\cref@chapter@name@plural~
#1}
154 \newcommand{\citesection}[1]{\cref@section@name~
#1}
155 \newcommand{\citesections}[1]{\cref@section@name@plural~
#1}
156 %\newcommand{\citesection}[1]{\S.~#1}
157 %\newcommand{\citesections}[1]{\S\S.~#1}
158 \newcommand{\citeparagraph}[1]{\P.~
#1}
159 \newcommand{\citeparagraphs}[1]{\P\P.~
#1}
160 \newcommand{\citelisting}[1]{\cref@listing@name~
#1}
164 \usepackage{booktabs
} % Nicer tables
165 \usepackage{multirow
} % Multirow cells
166 \usepackage{tabularx
} % Automatically wrapping tables
167 \usepackage{longtable
} % Tables spanning pages
168 \usepackage{threeparttable
} % Tables with footnotes
172 \usepackage[algochapter,linesnumbered,lined,boxed
]{algorithm2e
}
173 % Fix the algorithm font
174 \renewcommand\AlCapFnt{\normalfont}
175 \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
193 backgroundcolor=
\color{lstbg
},
196 postbreak=
\mbox{\textcolor{gray
}{$
\hookrightarrow$
}\space},
198 showstringspaces=false,
205 \usepackage{lstlangclean
}
206 \usepackage{lstlanghaskell
}
207 \usepackage{lstlangarduino
}
215 \newcommand{\cinline}[1]{\lstinline[language=c,postbreak=
]|
#1|
}
216 \newcommand{\arduinoinline}[1]{\lstinline[language=
{[Arduino
]C++
},postbreak=
]|
#1|
}
217 \newcommand{\pythoninline}[1]{\lstinline[language=Python,postbreak=
]|
#1|
}
218 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=
]|
#1|
}
219 \newcommand{\cleaninputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}\lstinputlisting[escapeinside=
{/*
}{*/
},language=Clean,
#1]{\subfix{#2}}}
220 \newcommand{\haskellinline}[1]{\lstinline[language=
{[Regular
]Haskell
},postbreak=
]|
#1|
}
221 \newcommand{\haskellinputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}\lstinputlisting[language=
{[Regular
]Haskell
},
#1]{\subfix{#2}}}
222 \newcommand{\haskelllhstexinline}[1]{\lstinline[language=
{[Lhs2Tex
]Haskell
},postbreak=
]|
#1|
}
223 %For storing listings in footnotes
225 % Fix list of listings title
226 \renewcommand{\lstlistlistingname}{List of Listings
}
227 % Fix list of listings chapter separator
229 \let\my@chapter\@chapter
%
230 \renewcommand*
{\@chapter
}{%
231 \addtocontents{lol
}{\protect\addvspace{10pt
}}%
235 \lstnewenvironment{lstPython
}[1][]
237 \lstset{language=Python,
#1}
238 \renewcommand*
{\lstlistingname}{Listing (
\gls{PYTHON
})
}
241 \lstnewenvironment{lstClean
}[1][]
243 \lstset{language=Clean,
#1}
244 \renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}
247 \lstnewenvironment{lstArduino
}[1][]
249 \lstset{language=
{[Arduino
]C++
},
#1}
250 \renewcommand*
{\lstlistingname}{Listing (
\gls{CPP
})
}
253 \lstnewenvironment{lstHaskell
}[1][]
255 \lstset{language=
{[Regular
]Haskell
},
#1}%
256 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
259 \lstnewenvironment{lstHaskellLhstex
}[1][]
261 \lstset{language=
{[Lhs2Tex
]Haskell
},
#1}%
262 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
267 \usepackage{graphicx} % Images
268 \graphicspath{{img/
},
{intro/img
},
{top/img
},
{tvt/img
}}
269 \usepackage{caption
} % subfigures/captionof
270 \usepackage{subcaption
}
271 \usepackage{rotating
}
272 \newcommand{\orcid}[1]{\href{https://orcid.org/
#1}{\hspace{1mm
}\includegraphics[width=
1em
]{orcid
}\hspace{2mm
} https://orcid.org/
#1}}
276 % Hyperlinks and metadata
277 \usepackage[hyphens
]{url
}
278 \usepackage[pdflang=
{en-GB
},pagebackref,breaklinks
]{hyperref
} % hyperlinks
279 \usepackage{xr
} % hyperlinks
280 \renewcommand*
{\backref}[1]{}
281 \renewcommand*
{\backrefalt}[4]{[{%
282 \ifcase #1 not cited.
\or p.~
#2.
\else pp.
#2.
\fi%chktex 1
286 pdfauthor=
{\myauthor},
287 pdfkeywords=
{task-oriented programming, functional programming, domain specific languages, internet of things
},
290 \usepackage[nodayofweek
]{datetime
} % Use a fixed document date
292 \usepackage{bookmark
}
293 \usepackage[noabbrev
]{cleveref
} % Easy references
294 \usepackage{crossreftools
} % Easy references
295 \crefname{equ
}{equation
}{equations
}
296 \crefname{part
}{episode
}{episodes
}
297 \crefname{lstlisting
}{listing
}{listings
}
298 \crefname{equ
}{definition
}{definition
}
299 \usepackage{nameref
} % to reference names of chapters
300 \newcommand{\fullref}[1]{\crtcref{#1}:
\nameref{#1}}
301 \newcommand{\Fullref}[1]{\crtCref{#1}:
\nameref{#1}}
302 \creflabelformat{equation
}{#2\textup{#1}#3}
304 % Glossaries and acronyms
305 \usepackage[nolangwarn,abbreviations,nonumberlist,prefix
]{glossaries-extra
}
306 \setabbreviationstyle{long-short
}
307 \setabbreviationstyle[noexpand
]{short-nolong
}
309 \usepackage{glossary-mcols
}
310 \pdfstringdefDisableCommands{%
312 \def\glsxtrlongpl#1{}%
313 \def\glsxtrshort#1{}%
314 \def\glsxtrshortpl#1{}%
318 \def\Glsxtrlongpl#1{}%
319 \def\Glsxtrshort#1{}%
320 \def\Glsxtrshortpl#1{}%
325 \def\glsentrytext#1{}%
328 \def\Glsentrytext#1{}%
330 \def\MakeUppercase#1{}%
334 %\usepackage{makeidx}
335 %\makeindex% Enable the index
337 % Custom enumerations
338 \usepackage[inline,shortlabels
]{enumitem
}
340 \setlist[description
]{leftmargin=
\parindent}
342 % Initialize the glossaries
346 \usepackage{subfiles
}
348 \ifSubfilesClassLoaded{}{
350 \includexmp{CC_Attribution-NoDerivatives_4.0_International
}
354 \newcommand{\GHCmod}[1]{\texttt{#1}}
355 \newcommand{\aramsingh}{Ramsingh, A.\ (University of Glasgow)
}
356 \newcommand{\dcolon}[0]{\mathbin{::
}}
357 \newcommand{\doifmt}[1]{\href{https://doi.org/
#1}{#1}}
358 \newcommand{\etc}{{\fontfamily{cmr
}\selectfont{\itshape\/\&
\kern-
0.2em c
}}}
359 \newcommand{\jsinger}{Singer, dr.\ J.\ (University of Glasgow)
}
360 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)
}
361 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)
}
362 \newcommand{\ptrinder}{Trinder, prof.~dr.\ P.\ (University of Glasgow)
}
363 \newcommand{\rdmentry}[5]{#1 (
#2):
#3.
#4.\
\doifmt{#5}}
364 \newcommand{\rewriterate}[2]{\langle{}#1,
#2\rangle{}}
365 \newcommand{\requiresGHCmod}[2][]{\footnote{Requires
\GHCmod{#2} to be enabled.
#1}}
366 \newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)
}
367 \newcommand{\erasmusplus}{ERASMUS
\raisebox{.25ex
}{+
}}
368 \newcommand{\imtask}{\gls{ITASK
}\slash\gls{MTASK
}}
369 \newcommand{\Imtask}{\Gls{ITASK
}\slash\gls{MTASK
}}
370 \newcommand{\citask}{\gls{CLEAN
}\slash\gls{ITASK
}}
371 \newcommand{\Citask}{\Gls{CLEAN
}\slash\gls{ITASK
}}
372 \newcommand{\cimtask}{\gls{CLEAN
}\slash\gls{ITASK
}\slash\gls{MTASK
}}
373 \newcommand{\Cimtask}{\Gls{CLEAN
}\slash\gls{ITASK
}\slash\gls{MTASK
}}
374 \newcommand{\ccpp}{\gls{C
}\slash\gls{CPP
}}
375 \newcommand{\Ccpp}{\Gls{C
}\slash\gls{CPP
}}
376 \newcommand{\stacksize}[1]{\parallel#1\parallel}
379 \newenvironment{compilationscheme
}
380 {\allowdisplaybreaks\startalign}