%&thesis
\usepackage[nonumberlist]{glossaries}  % Glossaries and acronyms
\usepackage[algochapter]{algorithm2e}             % Pseudocode
\renewcommand\AlCapFnt{\normalfont}
\makeglossaries%

\input{glossaries}

\begin{document}
\frontmatter{}

%Titlepage
\input{titlepage}

\glsaddall{}

%Abstract
\addcontentsline{toc}{chapter}{Abstract}
\chapter*{\centering Abstract}
\begin{quotation}
	\centering\noindent
	\input{abstract}
\end{quotation}

\addcontentsline{toc}{chapter}{Acknowledgements}
\chapter*{\centering Acknowledgements}
\begin{quotation}
	\centering\it\noindent
	\input{acknowledgements}
\end{quotation}

%Table of contents
\tableofcontents

\addcontentsline{toc}{chapter}{Glossaries \& Acronyms}
\printglossaries%

\mainmatter{}
\glsresetall{}
\chapter{Introduction}\label{chp:introduction}
\input{intro}

\chapter{Task Oriented Programming}\label{chp:top}
\input{top}

\chapter{Embedded Domain Specific Languages}\label{chp:dsl}
\input{edsl}

\chapter[The mTask-EDSL]{The \gls{mTask}-\gls{EDSL}}\label{chp:mtask}
\input{mtask}

\chapter[mTask system]{\gls{mTask} system}\label{chp:system}
\input{system}

\chapter[Extending the mTask EDSL]{Extending the \gls{mTask} {EDSL}}\label{chp:mtaskcont}
\input{mtaskext}

\chapter{System Architecture}\label{chp:arch}
\input{arch}

\chapter{Discussion \& Conclusion}\label{chp:conclusion}
\input{conclusion}

\appendix\label{chp:appendix}

\chapter{Communication protocol}\label{app:communication-protocol}
\input{appendix-protocol}

\chapter{Device client interface}\label{app:device-interface}
\input{appendix-device-interface}

\cleardoublepage{}
\phantomsection{}
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{ieeetr}
\bibliography{thesis}

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

\end{document}
