% -------------------------------------------------
%                  DRAFT OPTIONS
% -------------------------------------------------
% Three options going on here; use in any combination.  But remember to turn the first two off before
% generating a PDF to send to the printer!

% This adds a "DRAFT" footer to every normal page.  (The first page of each chapter is not a "normal" page.)
% \fancyfoot[C]{\emph{DRAFT Printed on \today}}  

% This highlights (in blue) corrections marked with (for words) \mccorrect{blah} or (for whole paragraphs) \begin{mccorrection} . . . \end{mccorrection}.  This can be useful for sending a PDF of your corrected thesis to your examiners for review.  Turn it off, and the blue disappears.
% \correctionstrue


% -------------------------------------------------
%              AUTHOR INFO / METADATA
% -------------------------------------------------

%%%%% THESIS / TITLE PAGE INFORMATION
% \title{Long-Term Robot Monitoring \\ with Uncertain Models}
\title{Long-Term Monitoring for Robots  with Probabilistic Models}
\author{Alex Stephens}
\college{Exeter College}

\degree{Doctor of Philosophy}
\degreedate{Michaelmas 2024}



% -------------------------------------------------
%                  PACKAGE IMPORTS
% -------------------------------------------------

% \usepackage[inline]{enumitem}

% Allow more than the default number of LaTeX fonts
\newcommand\hmmax{0} % default 3
\newcommand\bmmax{0} % default 4

\usepackage{bm}
\AtBeginDocument{\RenewCommandCopy\qty\SI}

\usepackage{siunitx}
\usepackage{physics}
% \usepackage{amssymb}
% \usepackage{upgreek}
\usepackage{algpseudocode}
\usepackage{subcaption}
% \usepackage{cite}
\usepackage{microtype}
% \usepackage{pifont}% http://ctan.org/pkg/pifont

\usepackage[chapter]{algorithm}
\usepackage{algorithmicx}
% \usepackage{amsthm}

% Libertine font
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\renewcommand{\ttdefault}{lmtt}
\DeclareMathAlphabet{\mathtt}{T1}{lmtt}{m}{n}
\newcommand{\semibold}{\libertineSB}


% Define a semibold command - blank if unsupported by chosen font
% \newcommand{\semibold}{}

\usepackage{moresize}

% Callout box
\usepackage[most]{tcolorbox}

% Some font enhancements - load after fonts are loaded
\usepackage{microtype}

% Figure wrapping
\usepackage{wrapfig}

% Use more than one optional parameter in a new commands
\usepackage{xargs}

% Package for writing ordinal numbers (1st, 2nd, etc.)
\usepackage[super]{nth}

% Package for highlighting text for corrections
\usepackage{soul}


% TODOs
% \usepackage[colorinlistoftodos, textwidth=30mm, color=blue!40]{todonotes}
% \usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes}
% Define the old todo command
\setlength{\marginparwidth}{2.5cm}\reversemarginpar
\usepackage[colorinlistoftodos,prependcaption,textsize=normalsize,backgroundcolor=yellow!50,bordercolor=orange, linecolor=yellow]{todonotes}
\let\oldtodo\todo
% \renewcommandx{\todo}[1]{\oldtodo[noline]{#1}}
\newcommandx{\info}[2][1=]{\todo[linecolor=blue,backgroundcolor=blue!25,bordercolor=blue,#1,noline]{#2}}
\newcommandx{\todoinline}[2][1=]{\todo[inline,size=\normalsize,linecolor=blue,backgroundcolor=blue!25,bordercolor=blue,#1]{#2}}
\newcommandx{\note}[2][1=]{\todo[inline,size=\normalsize,linecolor=orange,backgroundcolor=orange!25,bordercolor=orange,#1]{#2}}


%\newcommand{\highlight}[1]{\textcolor{magenta}{#1}}

% Redefine \fullcite to list all authors
\makeatletter
\DeclareCiteCommand{\fullcite}
{\defcounter{maxnames}{\blx@maxbibnames}%
    \usebibmacro{prenote}}
{\usedriver
    {\DeclareNameAlias{sortname}{default}}
    {\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footfullcite}[\mkbibfootnote]
{\defcounter{maxnames}{\blx@maxbibnames}%
    \usebibmacro{prenote}}
{\usedriver
    {\DeclareNameAlias{sortname}{default}}
    {\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\makeatother

% Make a simple tcolorbox for attribution callouts. Black outline, no fill
\newtcolorbox{attributionbox}{
    colback=white,
    colframe=black,
    boxrule=0.5pt,
    sharp corners,
    left=0.5em,
    right=0.5em,
    top=0.5em,
    bottom=0.5em
}
% Define a new env using the box
\newenvironment{attribution}{\begin{attributionbox}\paragraph*{Attribution}}{\end{attributionbox}}


% Define a light blue color for highlighting
\definecolor{lightblue}{RGB}{220,240,255}
\definecolor{brightyellow}{RGB}{255, 255, 100}

% Set the soul highlight color
\sethlcolor{brightyellow}

% Optional: define a custom command for clarity
% \newcommand{\correction}[1]{\hl{#1}}
\newcommand{\correction}[1]{#1}

% Custom spacing commands
\newcommand{\figvspace}{\par\bigskip}
\newcommand{\fighspace}{\hspace{0.7em}}


% Fix spacing in list of definitions (list of theorems)
\usepackage{xpatch}
% \makeatletter
% \xpretocmd{\@chapter}{\addtotheoremfile{\protect\addvspace{10\p@}}}{}{}{}%
% \makeatother
\xpretocmd{\chapter}{\addtotheoremfile{\protect\addvspace{10pt}}}{}{}%

% Research questions
\newlist{questions}{enumerate}{2}
\setlist[questions,1]{label=\textbf{RQ\arabic*},ref=\textbf{RQ\arabic*}, leftmargin=50pt}
\newlist{challenges}{enumerate}{2}
\setlist[challenges,1]{label=\textbf{C\arabic*},ref=\textbf{C\arabic*}, leftmargin=50pt}
% \setlist[questions,2]{label=(\alph*),ref=\thequestionsi(\alph*)}

\usepackage{epigraph}
\setlength{\epigraphwidth}{0.6\textwidth}


% Width of list columns for notation, abbrevs, etc. 
\newlength{\listcolwidth}
\setlength{\listcolwidth}{3.2cm}


% -------------------------------------------------
%                  ENVIRONMENTS
% -------------------------------------------------

\theoremstyle{plain}
\theorembodyfont{}
\renewtheorem{definition}{Definition}[chapter]

% Make a new theorem style with the ntheorem package
% \newcommand{\challengesymb}{~$\blacklozenge$~}
\makeatletter
\newtheoremstyle{challenge}%
{\item[\theorem@headerfont \llap{##1##2}\hskip\labelsep \theorem@separator]}%
{\item[\theorem@headerfont \llap{##1##2}\hskip\labelsep ##3\theorem@separator]}
% {\item[\theorem@headerfont \llap{##1##2}{\challengesymb}##3\theorem@separator]}
\makeatother

\theoremstyle{challenge}
\theoremseparator{: }
\theorembodyfont{}
\theoremindent3em
\theorempreskip{5pt}
\theorempostskip{5pt}
\newtheorem{challenge}{C}%

\newcommand{\challengeref}[1]{\hyperref[#1]{\textbf{C\ref*{#1}~\nameref*{#1}}}}
% \newcommand{\challengeref}[1]{\hyperref[#1]{\textbf{C\ref*{#1}\challengesymb\nameref*{#1}}}}

% Algorithm
\algnewcommand\Input{\textbf{Input: }}
\algnewcommand\Output{\textbf{Output: }}
\algnewcommand{\AlgOr}{\textbf{ or }}

% Text size in all algorithm environments
\newcommand{\algsize}{\footnotesize}

% -------------------------------------------------
%                  MACRO DEFINITIONS
% -------------------------------------------------

% Notation and aliases defined in a separate file
\input{frontmatter/symbols.tex}

