% !TeX root = ./main.tex
\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{graphicx}
\usepackage[citestyle=abstract,backend=biber,citestyle=ieee,natbib=true]{biblatex}
\usepackage{hyperref}
\usepackage[toc,acronym]{glossaries}
\usepackage[top=3cm,bottom=3cm,right=3cm,left=3cm]{geometry}
\usepackage{csquotes}
\usepackage{tabularx}
\usepackage{titlesec}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{multirow}


% For commands
\usepackage{minted}

% For PDF inserts
\usepackage{pdfpages}


% Colors and links - https://en.wikibooks.org/wiki/LaTeX/Hyperlinks
\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\hypersetup{
  colorlinks=true,
  linkcolor=blue!50!blue,
  urlcolor=blue!70!blue,
  citecolor=blue!70!blue,
  pdfborder = {0 0 0}
%	colorlinks=false,% hyperlinks will be black
%	linkbordercolor=blue,% hyperlink borders will be red
%	pdfborderstyle={/S/U/W 1}% border style will be underline of width 1pt
}


% Change figure numerotation
\counterwithin{figure}{section}
% Change table numerotation
\counterwithin{table}{section}

%%References
\bibliography{./references/bibliography.bib}
\loadglsentries{./references/glossary.tex}
\makeglossaries


% Lstlisting directives for code
\input{./references/lstlistings}


% Commands
\input{./commands/info.tex}
\input{./commands/renamings.tex}
\input{./commands/shortcuts.tex}


% Images path
\graphicspath{{./images/}}


% Spacing
\usepackage{parskip}
\setlength{\parskip}{\parskip}%
\setlength{\headheight}{15pt}


% No table float
\usepackage{float}
\restylefloat{table}


% table column
\newcolumntype{M}[1]{>{\raggedright}m{#1}}


% page style
\pagestyle{fancy}
\fancyhf{}


%Header and footer
\rhead{\studentName}
\lhead{\titleNameShort \ | \documenttype}
\cfoot{\thepage}


\begin{document}

\pagenumbering{gobble}

%Title page
\begin{titlepage}
   \include{./coverpage/coverpage}
\end{titlepage}

\pagenumbering{roman}

\setcounter{tocdepth}{2}
\tableofcontents
\newpage

\pagenumbering{arabic}

% Content
\input{./chapters/introduction.tex}
\newpage 
\input{./chapters/challenge.tex}
\newpage 
\input{./chapters/mitigation.tex}
\newpage 
\input{./chapters/conclusion.tex}
\newpage

\begin{appendix}
	\renewcommand{\thesubsection}{\thesection.\Alph{subsection}}
	\input{./appendices/appendices}
	\newpage
	\input{./chapters/softwares}
	\newpage
	\printglossary
	\newpage
	\printglossary[type=\acronymtype, title={Acronyms}]
	\newpage
	\nocite{*}
	\phantomsection
	\addcontentsline{toc}{section}{List of figures}
	\listoffigures
	%\newpage
	%\phantomsection 
	%\addcontentsline{toc}{section}{List of tables}
	%\listoftables
	\newpage
	\phantomsection
	\addcontentsline{toc}{section}{\renamelstlistings}
	\lstlistoflistings
	\newpage
	\phantomsection
	\addcontentsline{toc}{section}{References}
	\printbibliography
  	\label{bib}
\end{appendix}

\end{document}