% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = pdflatex

% toptesti document class
\documentclass[%
    a4paper, % not needed, by default it is a4paper, or also b5paper can be used
    corpo=12pt, % dimension of basic font
    % oneside is generally the way to go
    oneside, % two side optimizes for two-face printing, having chapters open on the right (aka odd numbers), if you don't want blank pages put oneside here
    stile=standard,
    %evenboxes, % not needed, to put supervisors and candidate at the same level
    tipotesi=magistrale,
    numerazioneromana, % roman numbering for appendixes and preambles, up to Table of Contents
    openright, % to force opening on the right for double-sided printing
    cucitura=7mm, % for printing, 7mm should be enough
    %dvipsnames, % for compatibility with xcolor, it does not work
]{toptesi}
 
\input{common/packages}
\input{common/package_config}

\input{common/new_commands}

\input{common/thesis_info.tex}

\input{common/font_config.tex}

\addbibresource{bibliography.bib}

% to load the glossaries, not needed if using bib2gls
\input{glossaries.tex}
\makeglossaries

\begin{document}

\input{common/config}

\input{common/toptesi_config}

\english % uncomment for English

% front page -- add your info in common/thesis_info.tex
\input{common/frontpage.tex} % new frontespizio (2023)
%\retrofrontespizio
% insert text for the back of the front page
% if you insert any remove the following \paginavuota
% either a blank page or a back is needed to have double-sided printing
% pay attention to leave the space for the page

\paginavuota % clears a page

\frontmatter % not strictly needed, as toptesi takes care of it already
%\input{content/dedica.tex}
\newpage
%\paginavuota
% abstract if needed
\begin{abstract}
     \input{content/abstract.tex}
\end{abstract}

% to create blank pages for openright in frontmatter
% use one of the following two methods
% 1) use the following three lines
%\phantom{0} % needed otherwise cleardoublepage does not clean the page because it sees it empty
%\cleardoublepage
%\thispagestyle{empty} % to have empty page, without numbers
% 2) or
\paginavuota % to manually create a blank page

% summary (uncomment until "end summary" if needed)
%\sommario
%\input{content/summary}

%\phantom{0}
%\cleardoublepage
%\thispagestyle{empty}
% end summary

\ringraziamenti % acknowledgements
\input{content/acknowledgements}

\paginavuota
\tableofcontents

%\listoftables % ToC for tables


\printnomenclature

\input{common/post_summary_config.tex}

\mainmatter

%\part{Prima Parte} % parts division, not needed
% Chapters always open on a right-side page, i.e. odd numbers, so a blank page is inserted if needed
%\cleardoublepage[empty] % to have a fully blank page
% a blank page appears before the first chapter in some configurations, on the last version it doesn't

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% chapters go here
\input{content/chapters/Intro}
\paginavuota
\input{content/chapters/StateofTheArt}
\input{content/chapters/VehDynamics}
\paginavuota
\input{content/chapters/ComparativeBaseline}
\input{content/chapters/FinalController}
\paginavuota
\input{content/chapters/SimulationAndResults}
\paginavuota
\input{content/chapters/Conclusions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paginavuota % it works even without stile=classica

%\printglossary[title=Glossary of Acronyms,type=\acronymtype]
\listoffigures % ToC for figures
\printglossary[type=\acronymtype, title={List of Acronyms}]
\paginavuota
\printglossary[style=altlist,type=main,title={Definitions}]


% actually abbreviation is the name used for acronym in glossaries-extra
% title sets the name
% type tells the type of glossary to print
% style overrides the global style
% here we are printing only abbreviations
% printunsrtglossary if using record, otherwise printglossary is ok
%\paginavuota
%\printunsrtglossary[style=altlist,title=Glossario,type=\glsxtrabbrvtype]

% also list of symbols here if needed
%\appendix
%\input{content/appendix}

% endnotes here if needed

\phantom{0}
\cleardoublepage
\paginavuota
\printbibliography[heading=bibintoc] % heading required to show it in ToC

\end{document}
