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