%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Document type, global settings, and packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt]{report} %12 point font for Times New Roman
\usepackage{graphicx} %for images and plots
\usepackage[letterpaper, left=1in, right=1in, top=1in, bottom=1in, includefoot,includehead,heightrounded]{geometry} %margins; include* forces the page numbers and other header/footer within margin space. Looks gross but required.
\usepackage{setspace} %use this package to set linespacing as desired
\usepackage{times} %set Times New Roman as the font
\usepackage[explicit]{titlesec} %title control and formatting
\usepackage[titles]{tocloft} %table of contents control and formatting
% \usepackage[backend=bibtex, sorting=none, bibstyle=ieee]{biblatex} %reference manager
\usepackage[bookmarks=true, hidelinks]{hyperref}
\usepackage{appendix} %for appendices
\usepackage{rotating} %for rotated, landscape images
\usepackage[normalem]{ulem} %for italicized text
\usepackage{xcolor}
\usepackage{chemformula} % Formula subscripts using \ch{}
\usepackage{siunitx}
% ---------------------------------------------------------------------------
% Added stuff to the template
% ---------------------------------------------------------------------------
\usepackage[style=ieee, dashed=false]{biblatex} %citation formatting
\usepackage[acronym,nonumberlist]{glossaries} %glossary
\makeglossaries
\usepackage{multirow} %multi-row tables
%
% Supplementary materials still show up in list of figures/tables
\usepackage{newfloat}
\DeclareFloatingEnvironment[name={Figure S}, fileext=lof]{suppfigure}
\DeclareFloatingEnvironment[name={Table S}, fileext=lot]{supptable}
% /Supplementary materials
%
% Top right page number (Fancy)
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[R]{\thepage}
% /Top right page number
%
% 1st page should be fancy
\makeatletter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{fancy}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter}
\makeatother
% /1st page should be fancy
%
\usepackage{tocvsec2} % approval page is not a chapter. Remove from toc by excluding all \chapter* from toc.
%
%
% DEBUGGING: show page margins
% \usepackage{showframe} % turn off when done
% ---------------------------------------------------------------------------
% Add more stuff if you want
% ---------------------------------------------------------------------------
% \usepackage[
% range-phrase ={\,\text{-}\,}, % separator in a range
% range-units = single, % only one unit in a range
% separate-uncertainty = true,
% per-mode = repeated-symbol,
% ]{siunitx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Add your bibliography file here
\bibliography{template_references}
% prevent certain fields in references from printing in bibliography
\AtEveryBibitem{\clearfield{issn}}
\AtEveryBibitem{\clearlist{issn}}
\AtEveryBibitem{\clearfield{language}}
\AtEveryBibitem{\clearlist{language}}
\AtEveryBibitem{\clearfield{doi}}
\AtEveryBibitem{\clearlist{doi}}
\AtEveryBibitem{\clearfield{url}}
\AtEveryBibitem{\clearlist{url}}
\AtEveryBibitem{%
\ifentrytype{online}
{}
{\clearfield{urlyear}\clearfield{urlmonth}\clearfield{urlday}}}
%%%%%%%%%%%%%%%%%%%%%%
% Start of Document
%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\doublespacing %set line spacing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title Page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{titlePage.tex}
\currentpdfbookmark{Title Page}{titlePage} %add PDF bookmark for this page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%copyright page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{copyright.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is the abstract
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagenumbering{arabic}
\setcounter{page}{2} % set the page number appropriately
\input{abstract.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Acknowledgments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{chapter}{Acknowledgments}
\input{acknowledgements.tex}
%\addtocontents{toc}{\cftpagenumbersoff{chapter}}
%\currentpdfbookmark{Acknowledgments}{acknowledgments}
%\addtocontents{toc}{\cftpagenumberson{chapter}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Preface
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{preface.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Abbreviations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{abbreviations.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Glossary
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% group gets rid of clearpage introducing blank page
% before the glossary
\begingroup
\let\clearpage\relax
\input{glossary.tex}
\glsaddall
\printglossary
\endgroup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Nomenclature
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{nomenclature.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Table of Contents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Format for Table of Contents
\renewcommand{\cftchapdotsep}{\cftdotsep} %add dot separators
\renewcommand{\cftchapfont}{\bfseries} %set title font weight
\renewcommand{\cftchappagefont}{} %set page number font weight
\renewcommand{\cftchappresnum}{Chapter }
\renewcommand{\cftchapaftersnum}{:}
\renewcommand{\cftchapnumwidth}{5em}
\renewcommand{\cftchapafterpnum}{\vskip\baselineskip} %set correct spacing for entries in single space environment
\renewcommand{\cftsecafterpnum}{\vskip\baselineskip} %set correct spacing for entries in single space environment
\renewcommand{\cftsubsecafterpnum}{\vskip\baselineskip} %set correct spacing for entries in single space environment
\renewcommand{\cftsubsubsecafterpnum}{\vskip\baselineskip} %set correct spacing for entries in single space environment
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
%format title font size and position (this also applys to list of figures and list of tables)
\titleformat{\chapter}[display]
{\normalfont\bfseries\filcenter}{\chaptertitlename\ \thechapter}{0pt}{\MakeUppercase{#1}}
\renewcommand\contentsname{Table of Contents}
\begin{singlespace}
\tableofcontents
\end{singlespace}
\currentpdfbookmark{Table of Contents}{TOC}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% List of figures and tables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{chapter}{List of Figures}
\begin{singlespace}
\setlength\cftbeforefigskip{\baselineskip} %manually set spacing between entries
\listoffigures
\end{singlespace}
\clearpage
\addcontentsline{toc}{chapter}{List of Tables}
\begin{singlespace}
\setlength\cftbeforetabskip{\baselineskip} %manually set spacing between entries
\listoftables
\end{singlespace}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CHAPTERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
% formatting
%%%%%%%%%%%%%%%%%%%%%%
% resume page numbering for rest of document
\clearpage
% Adjust chapter title formatting
\titleformat{\chapter}[display]
{\normalfont\bfseries\filcenter}{\MakeUppercase\chaptertitlename\ \thechapter}{0pt}{\MakeUppercase{#1}} %spacing between titles
\titlespacing*{\chapter}
{0pt}{0pt}{30pt} %controls vertical margins on title
% Adjust section title formatting
\titleformat{\section}{\normalfont\bfseries}{\thesection}{1em}{#1}
% Adjust subsection title formatting
\titleformat{\subsection}{\normalfont\bfseries}{\thesubsection}{0em}{\hspace{1em}#1}
% Adjust subsubsection title formatting
\titleformat{\subsubsection}{\normalfont\itshape}{\thesubsection}{1em}{#1}
% %%%%%%%%%%%%%%%%
% % Introduction
% %%%%%%%%%%%%%%%%
% \input{introduction.tex}
%%%%%%%%%%%%%%%%
% Chapter 1 - INTRODUCTION
%%%%%%%%%%%%%%%%
\input{chapter1.tex}
%%%%%%%%%%%%%%%%
% Chapter 2
%%%%%%%%%%%%%%%%
\input{chapter2.tex}
%%%%%%%%%%%%%%%%
% Chapter 3
%%%%%%%%%%%%%%%%
\input{chapter3.tex}
%%%%%%%%%%%%%%%%
% Chapter 4
%%%%%%%%%%%%%%%%
\input{chapter4.tex}
%%%%%%%%%%%%%%%%
% Chapter 5
%%%%%%%%%%%%%%%%
\input{chapter5.tex}
%%%%%%%%%%%%%%%%
% Chapter 6
%%%%%%%%%%%%%%%%
\input{conclusion.tex}
%%%%%%%%%%%%%%%%
% References
%%%%%%%%%%%%%%%%
\begin{singlespace} % use single-line spacing for multi-line text within a single reference
\setlength\bibitemsep{\baselineskip} %manually set separataion betwen items in bibliography to double space
\printbibliography[title={References}]
\end{singlespace}
\addcontentsline{toc}{chapter}{References} %add References section to Table of Contents
%%%%%%%%%%%%%%%%
% Appendices
%%%%%%%%%%%%%%%%
% \pagestyle{fancy}
\input{appendix.tex}
%%%%%%%%%%%%%%%%
% Vita
% Only for PhD students
% Masters students remove this line
%%%%%%%%%%%%%%%%
\input{vita.tex}
\end{document}