%%%%% CHOOSE PAGE LAYOUT
% The most common choices should be below.  You can also do other things, like replacing "a4paper" with "letterpaper", etc.

% This one will format for two-sided binding (ie left and right pages have mirror margins; blank pages inserted where needed):
% \documentclass[a4paper,twoside]{oxthesis}
% This one will format for one-sided binding (ie left margin > right margin; no extra blank pages):
%\documentclass[a4paper]{oxthesis}
% This one will format for PDF output (ie equal margins, no extra blank pages):
\documentclass[a4paper,nobind]{oxthesis} 

%%%%% SELECT YOUR 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

%%%%% BIBLIOGRAPHY SETUP
% \usepackage[square, numbers]{natbib}
\addbibresource{references.bib}




% Any additional package imports and macros
\input{frontmatter/preamble}

%%%%% THE ACTUAL DOCUMENT STARTS HERE
\begin{document}


% Customise how ranges show up
\sisetup{range-phrase=--, range-units=single}

%%%%% CHOOSE YOUR LINE SPACING HERE
% This is the official option.  Use it for your submission copy and library copy:
\setlength{\textbaselineskip}{22pt plus2pt}
% This is closer spacing (about 1.5-spaced) that you might prefer for your personal copies:
%\setlength{\textbaselineskip}{18pt plus2pt minus1pt}

% You can set the spacing here for the roman-numbered pages (acknowledgements, table of contents, etc.)
\setlength{\frontmatterbaselineskip}{17pt plus1pt minus1pt}

% Leave this line alone; it gets things started for the real document.
\setlength{\baselineskip}{\textbaselineskip}


%%%%% CHOOSE YOUR SECTION NUMBERING DEPTH HERE
% You have two choices.  First, how far down are sections numbered?  (Below that, they're named but
% don't get numbers.)  Second, what level of section appears in the table of contents?  These don't have
% to match: you can have numbered sections that don't show up in the ToC, or unnumbered sections that
% do.  Throughout, 0 = chapter; 1 = section; 2 = subsection; 3 = subsubsection, 4 = paragraph...

% The level that gets a number:
\setcounter{secnumdepth}{2}
% The level that shows up in the ToC:
\setcounter{tocdepth}{2}


%%%%% ABSTRACT SEPARATE
% This is used to create the separate, one-page abstract that you are required to hand into the Exam Schools.  You can comment it out to generate a PDF for printing or whatnot.
% \begin{abstractseparate}
% 	\input{frontmatter/abstract} % Create an abstract.tex file in the 'text' folder for your abstract.
% \end{abstractseparate}


% JEM: Pages are roman numbered from here, though page numbers are invisible until ToC.  This is in keeping with most typesetting conventions.
\begin{romanpages}


    % Title page
    \maketitle

    \input{frontmatter/epigraph}
    \input{frontmatter/acknowledgements}
    \input{frontmatter/abstract}

    %%%%% MINI TABLES
    % This lays the groundwork for per-chapter, mini tables of contents.  Comment the following line (and remove \minitoc from the chapter files) if you don't want this.  Un-comment either of the next two lines if you want a per-chapter list of figures or tables.
    \dominitoc % include a mini table of contents
    %\dominilof  % include a mini list of figures
    %\dominilot  % include a mini list of tables

    % This aligns the bottom of the text of each page.  It generally makes things look better.
    \flushbottom

    % Whole-document ToC
    \tableofcontents

    \listoffigures
    \mtcaddchapter

    % Uncomment to generate a list of tables:
    % \listoftables
    % \mtcaddchapter

    % List of definitions
    \chapter*{List of Definitions}%
    \addcontentsline{toc}{chapter}{List of Definitions}
    \mtcaddchapter
    \theoremlisttype{all}
    \listtheorems{definition}

    % \listoftodos[Notes]

    %%%%% LIST OF ABBREVIATIONS
    \include{frontmatter/abbreviations}
    \include{frontmatter/notation}
\end{romanpages}


%%%%% CHAPTERS
\flushbottom
\include{chapters/chIntro/chIntro}
\include{chapters/chBackground/chBackground}
\include{chapters/chRelatedWork/chRelatedWork}
\include{chapters/chLTM1/chLTM1}
\include{chapters/chLTM2/chLTM2}
\include{chapters/chLTM3/chLTM3}
\include{chapters/chSafeExp/chSafeExp}
\include{chapters/chConclusion/chConclusion}


\linespread{1.2}
\renewcommand*\MakeUppercase[1]{#1}

% Add heading and toc line
\chapter*{References}
\addcontentsline{toc}{chapter}{References}
\markboth{References}{References} % Headers (L/R)
\printbibliography[heading=none]


%%%%% APPENDICES
% \startappendices
% \include{appendices/appExample}
\end{document}
