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{relsize
} % \smaller command
15 \usepackage{siunitx
} % typeset units
16 \usepackage{xcolor
} % colors
17 \DeclareSIUnit\noop{\relax}
18 \DeclareSIUnit\celcius{{}^
{\circ}\kern-
\scriptspace\mathsf{C
}}
20 \DeclareMathSymbol{\shortminus}{\mathbin}{AMSa
}{"
39} %chktex 18
21 \newcommand{\dcolon}[0]{\mathbin{::
}}
23 % Internationalisation
24 \usepackage[dutch,russian,british
]{babel
}
26 %\babelfont[russian]{rm}{Liberation Serif}
28 % Papersize and layout
40 \usepackage{pdflscape
}
42 \usepackage{fancyhdr
} % Custom headers and footers
47 \setlength{\unitlength}{18mm
}
48 \newcommand{\blob}{{\color{gray
}\rule[-
.2\unitlength]{2\unitlength}{.5\unitlength}}}
49 \fancyhead[RE
]{\rightmark}
50 \fancyhead[LO
]{\leftmark}
51 \newcommand{\frontmatterfancy}[0]{
52 \fancyhead[RO
]{\thepage}
53 \fancyhead[LE
]{\thepage}
55 \newcommand{\mainmatterfancy}[0]{
59 \put(
1,-
\value{chapter
})
{\blob}
64 \put(-
3,-
\value{chapter
})
{\blob}
69 \newcommand{\backmatterfancy}[0]{
83 \renewcommand{\chaptermark}[1]{\markboth{\chaptername\
\thechapter.\
#1}{}}
84 \renewcommand{\sectionmark}[1]{\markright{\thesection.\
#1}}
85 %\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername}\ \thechapter.\ #1}{}}
86 %\renewcommand{\headrulewidth}{0pt}
87 \renewcommand{\footrulewidth}{0pt
}
88 \usepackage{etoolbox
} % To patch the chapter command
89 % Have better page numbering in chapters
90 \patchcmd{\chapter}{plain
}{headings
}{}{}
91 \usepackage{epigraph
} % Epigraph
92 \renewcommand\partname{Movement
} % Rename parts to movements (rhapsody uhu)
93 \addto\captionsbritish{\renewcommand{\partname}{Movement
}}
95 \titleformat{\part}[block
]
100 % This is required to make \nameref work (https://tex.stackexchange.com/questions/211035/problems-with-nameref-not-refering-to-the-correct-label-x-titlesec)
102 \let\titlesec@part
\part%
103 \renewcommand{\part}{\@ifstar
\part@star
\part@nostar
}
104 \def\part@star
#1{\NR@gettitle
{#1}\titlesec@part*
{#1}}
105 \def\part@nostar
{\@ifnextchar
[\part@nostar@opt
\part@nostar@nopt
} % chktex 9
106 \def\part@nostar@nopt
#1{\NR@gettitle
{#1}\titlesec@part
{#1}}
107 \def\part@nostar@opt
[#1]#2{\NR@gettitle
{#1}\titlesec@part
[#1]{#2}}
109 \newenvironment{chapterabstract
}{\begin{quotation
}}{\end{quotation
}}
111 % Increase the depth for the table of contents
112 \setcounter{secnumdepth
}{3}
113 \renewcommand{\contentsname}{Table of Contents
} % change the name of the TOC
114 \AtBeginDocument{\addtocontents{toc
}{\protect\thispagestyle{empty
}}} % to remove page numbering from the TOC
117 \usepackage[subpreambles=true
]{standalone
} % standalone figures
118 %\usepackage{morewrites} % fix no more room for a new \write
119 \usepackage{appendix
} % subappendices, appendices per chapter
122 \usepackage{natbib
} % Cite bib entry completely
123 \setlength{\bibsep}{0.0pt
}
125 %\bibliographystyle{alpha}
126 \bibliographystyle{abbrvnat
}
127 \apptocmd{\thebibliography}{\raggedright}{}{}
128 \usepackage{bibentry
} % Cite bib entry completely
130 \newcommand{\citeentry}[1]{\begin{NoHyper
}\bibentry{#1}\end{NoHyper
}.
\citep{#1}}
133 \newcommand{\citepage}[1]{p.~
#1}
134 \newcommand{\citepages}[1]{pp.~
#1}
135 \newcommand{\citechapter}[1]{\cref@chapter@name~
#1}
136 \newcommand{\citechapters}[1]{\cref@chapter@name@plural~
#1}
137 \newcommand{\citesection}[1]{\cref@section@name~
#1}
138 \newcommand{\citesections}[1]{\cref@section@name@plural~
#1}
139 %\newcommand{\citesection}[1]{\S.~#1}
140 %\newcommand{\citesections}[1]{\S\S.~#1}
141 \newcommand{\citeparagraph}[1]{\P.~
#1}
142 \newcommand{\citeparagraphs}[1]{\P\P.~
#1}
146 \usepackage{graphicx} % Images
147 \graphicspath{{img/
},
{intro/img
},
{top/img
},
{tvt/img
}}
148 \usepackage{caption
} % subfigures
149 \usepackage{subcaption
}
150 \usepackage{rotating
}
151 \newcommand{\orcid}[1]{\href{https://orcid.org/
#1}{\hspace{1mm
}\includegraphics[width=
1em
]{orcid
}\hspace{2mm
} https://orcid.org/
#1}}
155 \usepackage{booktabs
} % Nicer tables
156 \usepackage{multirow
} % Multirow cells
157 \usepackage{tabularx
} % Automatically wrapping tables
158 \usepackage{longtable
} % Tables spanning pages
159 \usepackage{threeparttable
} % Tables with footnotes
163 \usepackage[algochapter
]{algorithm2e
}
164 % Fix the algorithm font
165 \renewcommand\AlCapFnt{\normalfont}
166 \usepackage{listings
}
167 % https://tex.stackexchange.com/questions/149056/how-can-i-define-additional-literate-replacements-without-deleting-existing-ones
169 \def\addToLiterate#1{\edef\lst@literate
{\unexpanded\expandafter{\lst@literate
}\unexpanded{#1}}}
170 \lst@Key
{moreliterate
}{}{\addToLiterate{#1}}
172 % General listings settings
175 basicstyle=
\tt\small,
176 breakatwhitespace=false,
181 escapeinside=
{[+
}{+
]},
% chktex 9
185 postbreak=
\mbox{\textcolor{gray
}{$
\hookrightarrow$
}\space},
187 showstringspaces=false,
194 \usepackage{lstlangclean
}
195 \usepackage{lstlanghaskell
}
196 \usepackage{lstlangarduino
}
204 \newcommand{\cinline}[1]{\lstinline[language=c,postbreak=
]|
#1|
}
205 \newcommand{\arduinoinline}[1]{\lstinline[language=
{[Arduino
]C++
},postbreak=
]|
#1|
}
206 \newcommand{\pythoninline}[1]{\lstinline[language=Python,postbreak=
]|
#1|
}
207 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=
]|
#1|
}
208 \newcommand{\haskellinline}[1]{\lstinline[language=
{[Regular
]Haskell
},postbreak=
]|
#1|
}
209 \newcommand{\haskelllhstexinline}[1]{\lstinline[language=
{[Lhs2Tex
]Haskell
},postbreak=
]|
#1|
}
210 %For storing listings in footnotes
212 % Fix list of listings title
213 \renewcommand{\lstlistlistingname}{List of Listings
}
214 % Fix list of listings chapter separator
216 \let\my@chapter\@chapter
%
217 \renewcommand*
{\@chapter
}{%
218 \addtocontents{lol
}{\protect\addvspace{10pt
}}%
222 \lstnewenvironment{lstPython
}[1][]
224 \lstset{language=Python,
#1}
225 \renewcommand*
{\lstlistingname}{Listing (
\gls{PYTHON
})
}
228 \lstnewenvironment{lstClean
}[1][]
230 \lstset{language=Clean,
#1}
231 \renewcommand*
{\lstlistingname}{Listing (
\gls{CLEAN
})
}
234 \lstnewenvironment{lstArduino
}[1][]
236 \lstset{language=
{[Arduino
]C++
},
#1}
237 \renewcommand*
{\lstlistingname}{Listing (
\gls{ARDUINO
})
}
240 \lstnewenvironment{lstHaskell
}[1][]
242 \lstset{language=
{[Regular
]Haskell
},
#1}%
243 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
246 \lstnewenvironment{lstHaskellLhstex
}[1][]
248 \lstset{language=
{[Lhs2Tex
]Haskell
},
#1}%
249 \renewcommand*
{\lstlistingname}{Listing (
\gls{HASKELL
})
}
253 % Hyperlinks and metadata
254 \usepackage[pdflang=
{en-GB
},pagebackref
]{hyperref
} % hyperlinks
255 \usepackage{xr
} % hyperlinks
256 \renewcommand*
{\backref}[1]{}
257 \renewcommand*
{\backrefalt}[4]{[{%
258 \ifcase #1 not cited.
\or p.~
#2.
\else pp.
#2.
\fi%chktex 1
262 pdfauthor=
{\myauthor},
263 pdfkeywords=
{task-oriented programming, functional programming, domain specific languages, internet of things
},
266 \usepackage[nodayofweek
]{datetime
} % Use a fixed document date
268 \usepackage{bookmark
}
269 \usepackage[noabbrev
]{cleveref
} % Easy references
270 \crefname{part
}{movement
}{movements
}
271 \crefname{lstlisting
}{listing
}{listings
}
272 \usepackage{nameref
} % to reference names of chapters
273 \newcommand{\fullref}[1]{\Cref{#1}:
\nameref{#1}}
275 % Glossaries and acronyms
276 \usepackage[nolangwarn,acronym,nonumberlist
]{glossaries-extra
}
278 % Titlecase glossary commands
279 \newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}}
280 \newcommand{\Glst}[1]{\glst{#1}}
281 % Fix gls in hyperlink errors
282 \pdfstringdefDisableCommands{%
284 \def\glsxtrlongpl#1{}%
285 \def\glsxtrshort#1{}%
286 \def\glsxtrshortpl#1{}%
290 \def\Glsxtrlongpl#1{}%
291 \def\Glsxtrshort#1{}%
292 \def\Glsxtrshortpl#1{}%
297 \def\glsentrytext#1{}%
300 \def\Glsentrytext#1{}%
303 \usepackage{glossary-mcols
}
306 %\usepackage{makeidx}
307 %\makeindex% Enable the index
309 % Custom enumerations
310 \usepackage[inline,shortlabels
]{enumitem
}
312 \setlist[description
]{leftmargin=
\parindent}
314 % Initialize the glossaries
318 \usepackage{subfiles
}
320 \ifSubfilesClassLoaded{}{
322 \includexmp{CC_Attribution-NoDerivatives_4.0_International
}
326 \newcommand{\GHCmod}[1]{\texttt{#1}}
327 \newcommand{\requiresGHCmod}[2][]{\footnote{Requires
\GHCmod{#2} to be enabled.
#1}}
328 %\newcommand{\etc}{{\fontfamily{cmr}\selectfont{\itshape\/\&c}}}
329 \newcommand{\etc}{{\fontfamily{cmr
}\selectfont{\itshape\/\&
\kern-
0.2em c
}}}
330 \newcommand{\rdmentry}[6]{#1:
#2 (
#3):
#4.
#5.\
\href{https://doi.org/
#6}{#6}}
331 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)
}
332 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)
}
333 \newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)
}
335 \newcommand{\mypart}[3]{
336 \part[#2:
#3]{#2\\
[2ex
]\smaller{}#3}%