\documentclass[twoside,10pt]{book}

\def\mytitle{Orchestrating the Internet of Things with Task-Oriented Programming}
\def\mysubtitle{a purely functional rhapsody}
\def\myauthor{Mart Lubbers}
\def\mydate{\formatdate{31}{12}{2022}}

\input{preamble}

% To show hboxes even when in non-draft mode
\overfullrule=1mm

% Just for the todonotes, can go when it's finished
\usepackage{todonotes}
\setuptodonotes{
	backgroundcolor=white,
	linecolor=black,
	size=scriptsize,
}

% Document info
\title{\mytitle{} --- \mysubtitle{}}
\author{Mart Lubbers}

\date{\mydate}

\begin{document}
\selectlanguage{british}

\frontmatter%
\frontmatterfancy%

%Titlepage
\subfile{frontmatter/titlepage}
\newpage%

% Epigraph/motto
\subfile{frontmatter/motto}

% Table of contents
%\setcounter{tocdepth}{1}
\tableofcontents
\todo{reduce tocdepth to 1 before finishing}
\newpage%

% Dedication
\subfile{frontmatter/dedication}

\listoftodos%

% Reset glossary and thus the acronyms
\glsresetall{}

% The actual document
\mainmatter%
\mainmatterfancy%
\setcounter{chapter}{-1}

% Introduction
\subfile{introduction/introduction}
% DSL

\mypart{prt:dsl}{Prelude}{Domain-Specific Languages}%

% DSL Techniques
\subfile{domain-specific_languages/dsl_techniques}

% Deep embedding with class
\subfile{domain-specific_languages/class_deep_embedding}

% First-class data types
\subfile{domain-specific_languages/first-class_datatypes}

% Stack computations?
\subfile{domain-specific_languages/strongly-typed_multi-view_stack-based_computations}

\mypart{prt:top}{Exposition}{Task-Oriented Programming for the Internet of Things}%

\subfile{mtask/mtask}

\mypart{prt:tvt}{Transformation}{Tiered vs.\ tierless programming}%

\subfile{tiered_vs._tierless_programming/smart_campus}

\bookmarksetup{startatroot} % descend back out of the previous part
\addtocontents{toc}{\bigskip}% Insert some whitespace to make the TOC better
\subfile{conclusion/conclusion}

% Start appendix
\appendix%
\label{chp:appendix}
\addcontentsline{toc}{part}{Appendix}

\subfile{appendix/clean_for_haskell_programmers}
\subfile{appendix/bytecode}

\backmatter%
\backmatterfancy%
\bookmarksetup{startatroot} % descend back out of the appendix

% Bibliography
\phantomsection{}%
\label{chp:bibliography}
\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{other,self}

% Summary
\subfile{backmatter/summary}

% Samenvatting
\subfile{backmatter/samenvatting}

% Acknowledgements
\subfile{backmatter/acknowledgements}

% Research data management
\subfile{backmatter/research_data_management}

% Curriculum vitæ
\subfile{backmatter/curriculum_vitae}

% Glossary
\addcontentsline{toc}{chapter}{Glossary}%
\label{chp:glossaries}
\printglossaries%

% Lists of
\cleardoublepage{}
\phantomsection{}%
\label{chp:listsof...}
\addcontentsline{toc}{chapter}{Lists of \ldots}
\begingroup
\let\clearpage\relax
\let\cleardoublepage\relax
\listoffigures%
%\listoftables%
%\listofalgorithms%
%\lstlistoflistings%
\endgroup

% Index
%\addcontentsline{toc}{chapter}{Index}%
%\label{chp:index}
%\printindex

\end{document}
