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
23 \newcommand{\dcolon}[0]{\mathbin{::
}}
24 \newcommand{\refreshrate}[2]{\langle{}#1,
#2\rangle{}}
26 % Internationalisation
27 \usepackage[dutch,russian,british
]{babel
}
29 %\babelfont[russian]{rm}{Liberation Serif}
31 % Papersize and layout
43 \usepackage{pdflscape
}
45 \usepackage{fancyhdr
} % Custom headers and footers
50 \setlength{\unitlength}{18mm
}
51 \newcommand{\blob}{{\color{gray
}\rule[-
.2\unitlength]{2\unitlength}{.5\unitlength}}}
52 \fancyhead[RE
]{\rightmark}
53 \fancyhead[LO
]{\leftmark}
54 \newcommand{\frontmatterfancy}[0]{
55 \fancyhead[RO
]{\thepage}
56 \fancyhead[LE
]{\thepage}
58 \newcommand{\mainmatterfancy}[0]{
62 \put(
1,-
\value{chapter
})
{\blob}
67 \put(-
3,-
\value{chapter
})
{\blob}
72 \newcommand{\backmatterfancy}[0]{
86 \renewcommand{\chaptermark}[1]{\markboth{\chaptername\
\thechapter.\
#1}{}}
87 \renewcommand{\sectionmark}[1]{\markright{\thesection.\
#1}}
88 %\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername}\ \thechapter.\ #1}{}}
89 %\renewcommand{\headrulewidth}{0pt}
90 \renewcommand{\footrulewidth}{0pt
}
91 \usepackage{etoolbox
} % To patch the chapter command
92 % Have better page numbering in chapters
93 \patchcmd{\chapter}{plain
}{headings
}{}{}
94 \usepackage{epigraph
} % Epigraph
95 \renewcommand\partname{Episode
} % Rename parts to episodes (rhapsody uhu)
96 \addto\captionsbritish{\renewcommand{\partname}{Episode
}}
98 \titleformat{\part}[block
]
100 {\partname~
\thepart:
}
103 % This is required to make \nameref work (https://tex.stackexchange.com/questions/211035/problems-with-nameref-not-refering-to-the-correct-label-x-titlesec)
105 \let\titlesec@part
\part%
106 \renewcommand{\part}{\@ifstar
\part@star
\part@nostar
}
107 \def\part@star
#1{\NR@gettitle
{#1}\titlesec@part*
{#1}}
108 \def\part@nostar
{\@ifnextchar
[\part@nostar@opt
\part@nostar@nopt
} % chktex 9
109 \def\part@nostar@nopt
#1{\NR@gettitle
{#1}\titlesec@part
{#1}}
110 \def\part@nostar@opt
[#1]#2{\NR@gettitle
{#1}\titlesec@part
[#1]{#2}}
112 \newenvironment{chapterabstract
}{\begin{quotation
}\em\noindent}{\end{quotation
}} %chktex 6
114 % Increase the depth for the table of contents
115 \setcounter{secnumdepth
}{3}
116 \renewcommand{\contentsname}{Table of Contents
} % change the name of the TOC
117 \AtBeginDocument{\addtocontents{toc
}{\protect\thispagestyle{empty
}}} % to remove page numbering from the TOC
120 \usepackage[subpreambles=true
]{standalone
} % standalone figures
121 %\usepackage{morewrites} % fix no more room for a new \write
122 \usepackage{appendix
} % subappendices, appendices per chapter
125 \usepackage{natbib
} % Cite bib entry completely
126 \setlength{\bibsep}{0.0pt
}
128 %\bibliographystyle{alpha}
129 \bibliographystyle{abbrvnat
}
130 \apptocmd{\thebibliography}{\raggedright}{}{}
131 \usepackage{bibentry
} % Cite bib entry completely
133 \newcommand{\citeentry}[1]{\begin{NoHyper
}\bibentry{#1}\end{NoHyper
}.
\citep{#1}}
136 \newcommand{\citepage}[1]{p.~
#1}
137 \newcommand{\citepages}[1]{pp.~
#1}
138 \newcommand{\citechapter}[1]{\cref@chapter@name~
#1}
139 \newcommand{\citechapters}[1]{\cref@chapter@name@plural~
#1}
140 \newcommand{\citesection}[1]{\cref@section@name~
#1}
141 \newcommand{\citesections}[1]{\cref@section@name@plural~
#1}
142 %\newcommand{\citesection}[1]{\S.~#1}
143 %\newcommand{\citesections}[1]{\S\S.~#1}
144 \newcommand{\citeparagraph}[1]{\P.~
#1}
145 \newcommand{\citeparagraphs}[1]{\P\P.~
#1}
149 \usepackage{graphicx} % Images
150 \graphicspath{{img/
},
{intro/img
},
{top/img
},
{tvt/img
}}
151 \usepackage{caption
} % subfigures
152 \usepackage{subcaption
}
153 \usepackage{rotating
}
154 \newcommand{\orcid}[1]{\href{https://orcid.org/
#1}{\hspace{1mm
}\includegraphics[width=
1em
]{orcid
}\hspace{2mm
} https://orcid.org/
#1}}
158 \usepackage{booktabs
} % Nicer tables
159 \usepackage{multirow
} % Multirow cells
160 \usepackage{tabularx
} % Automatically wrapping tables
161 \usepackage{longtable
} % Tables spanning pages
162 \usepackage{threeparttable
} % Tables with footnotes
166 \usepackage[algochapter,linesnumbered,lined,boxed
]{algorithm2e
}
167 % Fix the algorithm font
168 \renewcommand\AlCapFnt{\normalfont}
169 \usepackage{listings
}
170 % https://tex.stackexchange.com/questions/149056/how-can-i-define-additional-literate-replacements-without-deleting-existing-ones
172 \def\addToLiterate#1{\edef\lst@literate
{\unexpanded\expandafter{\lst@literate
}\unexpanded{#1}}}
173 \lst@Key
{moreliterate
}{}{\addToLiterate{#1}}
175 % General listings settings
178 basicstyle=
\tt\small,
179 breakatwhitespace=false,
184 escapeinside=
{[+
}{+
]},
% chktex 9
188 postbreak=
\mbox{\textcolor{gray
}{$
\hookrightarrow$
}\space},
190 showstringspaces=false,
197 \usepackage{lstlangclean
}
198 \usepackage{lstlanghaskell
}
199 \usepackage{lstlangarduino
}
207 \newcommand{\cinline}[1]{\lstinline[language=c,postbreak=
]|
#1|
}
208 \newcommand{\arduinoinline}[1]{\lstinline[language=
{[Arduino
]C++
},postbreak=
]|
#1|
}
209 \newcommand{\pythoninline}[1]{\lstinline[language=Python,postbreak=
]|
#1|
}
210 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=
]|
#1|
}
211 \newcommand{\cleaninputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}\lstinputlisting[language=Clean,
#1]{#2}}
212 \newcommand{\haskellinline}[1]{\lstinline[language=
{[Regular
]Haskell
},postbreak=
]|
#1|
}
213 \newcommand{\haskellinputlisting}[2][]{\renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}\lstinputlisting[language=
{[Regular
]Haskell
},
#1]{#2}}
214 \newcommand{\haskelllhstexinline}[1]{\lstinline[language=
{[Lhs2Tex
]Haskell
},postbreak=
]|
#1|
}
215 %For storing listings in footnotes
217 % Fix list of listings title
218 \renewcommand{\lstlistlistingname}{List of Listings
}
219 % Fix list of listings chapter separator
221 \let\my@chapter\@chapter
%
222 \renewcommand*
{\@chapter
}{%
223 \addtocontents{lol
}{\protect\addvspace{10pt
}}%
227 \lstnewenvironment{lstPython
}[1][]
229 \lstset{language=Python,
#1}
230 \renewcommand*
{\lstlistingname}{Listing (
\gls{PYTHON
})
}
233 \lstnewenvironment{lstClean
}[1][]
235 \lstset{language=Clean,
#1}
236 \renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}
239 \lstnewenvironment{lstArduino
}[1][]
241 \lstset{language=
{[Arduino
]C++
},
#1}
242 \renewcommand*
{\lstlistingname}{Listing (
\gls{CPP
})
}
245 \lstnewenvironment{lstHaskell
}[1][]
247 \lstset{language=
{[Regular
]Haskell
},
#1}%
248 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
251 \lstnewenvironment{lstHaskellLhstex
}[1][]
253 \lstset{language=
{[Lhs2Tex
]Haskell
},
#1}%
254 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
258 % Hyperlinks and metadata
259 \usepackage[pdflang=
{en-GB
},pagebackref
]{hyperref
} % hyperlinks
260 \usepackage{xr
} % hyperlinks
261 \renewcommand*
{\backref}[1]{}
262 \renewcommand*
{\backrefalt}[4]{[{%
263 \ifcase #1 not cited.
\or p.~
#2.
\else pp.
#2.
\fi%chktex 1
267 pdfauthor=
{\myauthor},
268 pdfkeywords=
{task-oriented programming, functional programming, domain specific languages, internet of things
},
271 \usepackage[nodayofweek
]{datetime
} % Use a fixed document date
273 \usepackage{bookmark
}
274 \usepackage[noabbrev
]{cleveref
} % Easy references
275 \crefname{part
}{episode
}{episodes
}
276 \crefname{lstlisting
}{listing
}{listings
}
277 \usepackage{nameref
} % to reference names of chapters
278 \newcommand{\fullref}[1]{\cref{#1}:
\nameref{#1}}
279 \newcommand{\Fullref}[1]{\Cref{#1}:
\nameref{#1}}
280 \creflabelformat{equation
}{#2\textup{#1}#3}
282 % Glossaries and acronyms
283 \usepackage[nolangwarn,abbreviations,nonumberlist,prefix
]{glossaries-extra
}
284 \setabbreviationstyle[acronym
]{long-short
}
286 % Titlecase glossary commands
287 \newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}}
288 \newcommand{\Glst}[1]{\glst{#1}}
289 \usepackage{glossary-mcols
}
290 \pdfstringdefDisableCommands{%
292 \def\glsxtrlongpl#1{}%
293 \def\glsxtrshort#1{}%
294 \def\glsxtrshortpl#1{}%
298 \def\Glsxtrlongpl#1{}%
299 \def\Glsxtrshort#1{}%
300 \def\Glsxtrshortpl#1{}%
305 \def\glsentrytext#1{}%
308 \def\Glsentrytext#1{}%
313 %\usepackage{makeidx}
314 %\makeindex% Enable the index
316 % Custom enumerations
317 \usepackage[inline,shortlabels
]{enumitem
}
319 \setlist[description
]{leftmargin=
\parindent}
321 % Initialize the glossaries
325 \usepackage{subfiles
}
327 \ifSubfilesClassLoaded{}{
329 \includexmp{CC_Attribution-NoDerivatives_4.0_International
}
333 \newcommand{\GHCmod}[1]{\texttt{#1}}
334 \newcommand{\requiresGHCmod}[2][]{\footnote{Requires
\GHCmod{#2} to be enabled.
#1}}
335 %\newcommand{\etc}{{\fontfamily{cmr}\selectfont{\itshape\/\&c}}}
336 \newcommand{\etc}{{\fontfamily{cmr
}\selectfont{\itshape\/\&
\kern-
0.2em c
}}}
337 \newcommand{\rdmentry}[5]{#1 (
#2):
#3.
#4.\
\href{https://doi.org/
#5}{#5}}
338 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)
}
339 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)
}
340 \newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)
}
341 \newcommand{\aramsingh}{Ramsingh, A.\ (University of Glasgow)
}
342 \newcommand{\jsinger}{Singer, dr.\ J.\ (University of Glasgow)
}
343 \newcommand{\ptrinder}{Trinder, prof.~dr.\ P.\ (University of Glasgow)
}
345 \newcommand{\mypart}[3]{
346 \part[#2:
#3]{#2\\
[2ex
]\smaller{}#3}%