+\usepackage{geometry} % Papersize
+\usepackage[british]{babel} % Internationalization
+\usepackage[titletoc]{appendix} % Appendices
+\usepackage[hidelinks]{hyperref} % Hyperlinks
+\usepackage{graphicx} % Graphics
+\usepackage{booktabs} % Better looking tables
+\usepackage{etoolbox} % Patch chapter command
+\usepackage[nodayofweek]{datetime} % Use a fixed document date
+\usepackage{listings} % Code
+\usepackage[acronym,nonumberlist]{glossaries} % Glossaries and acronyms
+\usepackage[algochapter]{algorithm2e} % Pseudocode
+\usepackage{makeidx} % Index
+
+% Have better page numbering in chapters
+\patchcmd{\chapter}{plain}{headings}{}{}
+
+% Images directory
+\graphicspath{{img/}}
+
+% Fix list of listings title
+\renewcommand{\lstlistlistingname}{List of Listings}
+
+% Fix list of listings chapter separator
+\makeatletter
+\let\my@chapter\@chapter%
+\renewcommand*{\@chapter}{%
+ \addtocontents{lol}{\protect\addvspace{10pt}}%
+ \my@chapter}
+\makeatother
+
+% Always have url in teletype
+\urlstyle{tt}
+
+% Setup pdf parameters
+\hypersetup{%
+ pdftitle={},
+ pdfauthor={},
+ pdfsubject={},
+ pdfcreator={},
+ pdfproducer={},
+ pdfkeywords={},
+}
+
+% Fix gls in hyperlink errors
+\pdfstringdefDisableCommands{%
+ \def\acrlong#1{}%
+ \def\acrlongpl#1{}%
+ \def\acrshort#1{}%
+ \def\acrshortpl#1{}%
+ \def\acrfull#1{}%
+ \def\acrfullpl#1{}%
+ \def\Acrlong#1{}%
+ \def\Acrlongpl#1{}%
+ \def\Acrshort#1{}%
+ \def\Acrshortpl#1{}%
+ \def\Acrfull#1{}%
+ \def\Acrfullpl#1{}%
+ \def\gls#1{}%
+ \def\glspl#1{}%
+ \def\Gls#1{}%
+ \def\Glspl#1{}%
+}
+
+% General listings settings
+\lstset{%
+ breakatwhitespace=false,
+ breaklines=true,
+ captionpos=b,
+ keepspaces=true,
+ basicstyle=\ttfamily\fontseries{l}\footnotesize,
+ commentstyle=\slshape\fontseries{m},
+ keywordstyle=\bfseries\fontseries{b},
+ stringstyle=\ttfamily,
+ showspaces=false,
+ showstringspaces=false,
+ showtabs=false,
+ tabsize=4,
+ frame=L,
+}
+
+% Increase the depth for the table of contenst
+\setcounter{secnumdepth}{3}
+
+% Fix the algorithm font
+\renewcommand\AlCapFnt{\normalfont}
+
+% Initialize the glossaries
+\makeglossaries%
+\input{glossaries}
+
+% Enable the index
+\makeindex%