\documentclass[british, twoside]{report}

\usepackage[a4paper, width=150mm, top=25mm, bottom=25mm, bindingoffset=6mm]{geometry}

% Page styling
\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage{csquotes}
\usepackage{babel}
\usepackage{parskip}

\usepackage{xcolor}

%\usepackage{vdmlisting}
\usepackage{listings}
\usepackage{minted}

\AtBeginDocument{%
  \renewcommand{\thelisting}{%
    \thechapter.\arabic{listing}%
  }
}

\providecommand*{\listingautorefname}{Listing}

% Taken from vdmlisting
\lstdefinelanguage{VDM_SL}
  {morekeywords={RESULT,\#else,\#endif,\#ifdef,\#ifndef,abs,all,always,and,as,atomic,be,be st,bool,by,card,cases,char,comp,compose,conc,dcl,def,definitions,dinter,div,dlmodule,do,dom,dunion,
  elems,else,elseif,end,eq,error,errs,exists,exists1,exit,exports,ext,false,floor,for,for all,forall,from,functions,hd,if,imports,in,in set,inds,init,inmap,int,inter,inv,inverse,iota,is,is not yet specified,is\_,lambda,len,let,map,measure,merge,mk\_,mod,module,mu,munion,nat,nat1,nil,not,not in set,of,operations,or,ord,others,post,power,pre,psubset,pure,rat,rd,real,rem,renamed,return,reverse,rng,
  seq,seq1,set,set1,skip,specified,st,state,struct,subset,then,tixe,tl,to,token,traces,trap,true,types,undefined,
  union,uselib,values,while,with,wr,yet
},
  sensitive,
  morecomment=[l]--,
  morestring=[b]",
  morestring=[b]',
}[keywords,comments,strings]

\lstset{
  language=VDM_SL,
  numbers=left,
  breaklines,
  basicstyle=\ttfamily,
  commentstyle=\color{gray},
  prebreak=\textrightarrow,
}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows, positioning, er}

\tikzstyle{box} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black]
\tikzstyle{arrow} = [thick,>=stealth]

% Tables
\usepackage{xltabular}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{array}

\usepackage{pgf-pie}

\usepackage{graphicx}

\usepackage{siunitx}
\usepackage[super]{nth}

% For word counts
\immediate\write18{texcount -1 -sum -inc \jobname.tex -out=\jobname.sum}

\newcommand\wordcount{\input{\jobname.sum}}

% For referencing
\usepackage[citestyle=ieee]{biblatex}
\addbibresource{references.bib}

% This should be loaded last
\usepackage[colorlinks,breaklinks]{hyperref}
\usepackage{subfiles}

\author{Anthony Berg (200871682)\\
Supervisor: Leo Freitas\\\\
Word Count: \wordcount}
\title{Testing Quick Reference Handbooks in Flight Simulators}

\hypersetup{
    pdfinfo = {
        Title = Testing Quick Reference Handbooks in Flight Simulators,
        Author = Anthony Berg,
        Subject = BSc Computer Science Dissertation,
    }
}

\newcommand{\lfcomment}[1]{\textcolor{blue}{\textbf{LF}:~#1}}
%Uncomment below to remove comments from PDF yet keeping in the LaTeX :-)
\renewcommand{\lfcomment}[1]{\relax}

\begin{document}
\maketitle

\pagenumbering{roman}
\chapter*{Preface}
\section*{Abstract}
% TODO
This is an abstract.

\section*{Declaration}
I declare that this dissertation represents my own work except where otherwise stated.

\section*{Acknowledgements}
I would like to thank my supervisor Leo Freitas for supporting, guiding, and providing
with areas of improvement for me throughout the project.

\tableofcontents

\chapter{Introduction}
\pagenumbering{arabic}
\subfile{chapters/introduction.tex}

\chapter{Background}
\subfile{chapters/background.tex}

\chapter{Design/Implementation}
\subfile{chapters/design.tex}

\chapter{Results}
\subfile{chapters/results.tex}

\chapter{Conclusion}
\subfile{chapters/conclusion.tex}

\appendix
\chapter{Formal Model}
\subfile{chapters/appendix/formal.tex}

\chapter{Database}
\subfile{chapters/appendix/database.tex}

% References
\printbibliography[heading=bibintoc, title={References}]

\end{document}

