%
\documentclass[12pt]{thesis} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{titlesec}
\usepackage{enumitem}
\usepackage[centerlast,small,bf]{caption}
\usepackage{geometry}
\usepackage[T1]{fontenc}        % euro quality fonts [T1] (togeth. w/ textcomp)
\usepackage{textcomp, amssymb}  % additional symbols (there are more packages)
%\usepackage[latin1]{inputenc}   % umlaute in input file
\usepackage{setspace}           % doublespacing
\usepackage{anysize}            % margin package sets tighter margins
\usepackage[all]{xy}            % creating figures within latex
%\usepackage[tight]{subfigure}% subfigures: figures within figures
%\marginsize{1.2in}{0.9in}{1.1in}{0.9in} % small margins
% \marginsize{1.2in}{0.9in}{0.5in}{1in} % small margins
\marginsize{1.0in}{1.0in}{1.0in}{1.0in} % small margins

% hyperref must be the second last package and glossary the last package

% index
\usepackage{makeidx}                       % for \printindex
\makeindex                                 % creates paper.idx index file
\usepackage{xcolor}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{graphicx}
%\usepackage{cite}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{balance}
\usepackage{array}
%\usepackage{nohyperref}
\usepackage{tikz}
\usepackage{float}
\usepackage{blindtext}
\usepackage{enumitem}
\usepackage{soul}
\usepackage{amssymb}
\usepackage{bbm}
\usepackage{gensymb}
\usepackage{amsfonts}
\usepackage{caption}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{dblfloatfix}
\usepackage[square,numbers]{natbib}
\bibliographystyle{IEEEtranN}
\usepackage{booktabs}
\usepackage{IEEEtrantools}
\usepackage{eufrak}
\usepackage{subcaption,titlesec}
\usepackage{booktabs}
\newcommand{\tabitem}
% \usepackage{xparse,mathtools}

\usetikzlibrary{shapes.geometric, arrows}

\newcommand{\squeezeup}{\vspace{-2.5mm}}
\renewcommand{\labelenumi}{\theenumi}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\interdisplaylinepenalty=2500

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

\newcommand{\algrule}[1][.2pt]{\par\vskip.5\baselineskip\hrule height #1\par\vskip.5\baselineskip}

\newcounter{tempEquationCounter} 
\newcounter{thisEquationNumber}
\newenvironment{floatEq}
{\setcounter{thisEquationNumber}{\value{equation}}\addtocounter{equation}{1}% record equation as happened and remember number
\begin{figure*}[!t]% float following equation across columns
\normalsize\setcounter{tempEquationCounter}{\value{equation}}% record current equation number in floated location
\setcounter{equation}{\value{thisEquationNumber}}% use previous equation number
}
{\setcounter{equation}{\value{tempEquationCounter}}% set back to equation number in floated location
\hrulefill\vspace*{-8pt}% add a horizontal rule separator
\end{figure*}% end float environment
}

%%% style and finetuning %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pagestyle{plain}               % pagestyle: headings, empty, plain

% new theorems
\newtheorem{example}{Example}
\newtheorem{proof}{Proof}
\newtheorem{theorem}{Theorem}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage{resizegather}
%%% document %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\graphicspath{{folder/}{Figures/}}

\usepackage{bibspacing}
\setlength{\bibitemsep}{1.7\baselineskip plus .05\baselineskip minus .05\baselineskip}

\usepackage{sectsty}
\chapterfont{\large\bfseries}
\sectionfont{\large\bfseries}
\sectionfont{\normalsize\bfseries}
%\subsectionfont{\normalsize\normalfont \itshape}
\subsectionfont{\normalsize \itshape}
\subsubsectionfont{\normalsize \itshape}
\usepackage{titlesec}

\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}

\titleformat{\chapter}[display]
{\bfseries\large}
{\vspace{-8ex} \titlerule \filright\MakeUppercase{ \chaptertitlename}  \large\thechapter}
{1ex}
{\titlerule\vspace{1ex}\filright}
[\vspace{-5ex}]

\titleformat{name=\chapter,numberless}[display]
{\bfseries\large}
{\vspace{-14ex}  \filright}
{1ex}
{\titlerule\vspace{1ex}\filright}
[\vspace{-5ex}]


\setcounter{secnumdepth}{5}


\begin{document}

\pagenumbering{roman} % titlepage does not get a number - that's odd, but good.

\ifpdf\pdfbookmark[1]{Title}{label:title}\fi              \input{titlepage.tex}


{\doublespacing
\newpage\ifpdf\pdfbookmark[1]{Acknowledgment}{label:ack}\fi\input{acknowledge.tex}
}

\setcounter{tocdepth}{2} 
\tableofcontents

\newpage\ifpdf\pdfbookmark[1]{List of Figures}{label:lof}\fi     \listoffigures

\newpage\ifpdf\pdfbookmark[1]{ \vspace*{-50mm} List of Tables}{label:lot}\fi     \vspace{-50mm}    \listoftables

{\doublespacing
        \newpage\ifpdf\pdfbookmark[1]{Abstract}{label:abst}\fi     \input{abstract.tex}
}
{\doublespacing
\newpage\pagenumbering{arabic}

\newpage\input{Chapter1}
\newpage\input{Chapter2}
\newpage\input{Chapter3}
\newpage\input{Chapter4}
\newpage\input{Chapter5}
\newpage\input{Chapter6}
\newpage\input{Chapter7}
\newpage\input{Chapter8}
\newpage\input{Chapter9}
% Bibliography and Glossary          (\phantomsection is needed for hyperlinks)


\newpage\phantomsection%
\addcontentsline{toc}{chapter}{List of Abbreviations}
\newpage\input{abbreviations.tex}


\newpage\phantomsection%
\addcontentsline{toc}{chapter}{List of Key Symbols}
\newpage\input{symbols.tex}

\DeclareRobustCommand{\mybox}[2][gray!40]{%
	\begin{tcolorbox}[   %% Adjust the following parameters at will.
		breakable,
		left=0pt,
		right=0pt,
		top=0pt,
		bottom=0pt,
		colback=#1,
		colframe=#1,
		width=\dimexpr\textwidth\relax, 
		enlarge left by=0mm,
		boxsep=5pt,
		arc=0pt,outer arc=0pt,
		]
		#2
	\end{tcolorbox}
}


\titleformat{\paragraph}
{\normalfont\normalsize}{\theparagraph}{0.5em}{}
\titlespacing*{\paragraph}
{0pt}{1.25ex plus 1ex minus .2ex}{.1ex}


%\newpage\phantomsection%

\begin{singlespace}
%       \setlength\bibitemsep{0pt}

\addcontentsline{toc}{chapter}{References}              % add Bibliography to TOC
% \bibliographystyle{unsrtnat}
\bibliography{reference}
\end{singlespace}
%\addcontentsline{toc}{chapter}{Appendix}
\newpage\input{appendixA}
\newpage\input{appendixB}
\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
