\documentclass[b5paper]{book}

\input{preamble}

% Document info
\title{Some title}
\author{Some author\\
	{\small\href{mailto:mail@example.com}{mail@example.com}}}

% If you want to fix the date: \formatdate{10}{7}{2017}}
\date{\today}

\begin{document}
\frontmatter{}

%Titlepage
\input{titlepage}

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

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

% Table of contents
\tableofcontents

% Reset glossary and thus the acronyms
\glsresetall{}

% The actual document
\mainmatter{}

\chapter{Example}%
\label{chp:example}
\input{example}

% Start appendix
\appendix%
\label{chp:appendix}

% Bibliography
\phantomsection{}%
\label{chp:bibliography}
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{plain}
\bibliography{thesis}

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

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

% 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

\end{document}
