% -*- Mode:TeX -*-
%% The documentclass options along with the pagestyle can be used to generate
%% a technical report, a draft copy, or a regular thesis.  You may need to
%% re-specify the pagestyle after you \include  cover.tex.  For more
%% information, see the first few lines of sk-thesis.cls. 
% DRAFT MODE uses simpler front page, without dedication, acknowledgements, uses a footer sying draft.
%\documentclass[12pt,a4paper,vi,twoside,leftblank]{sk-thesis}
%\documentclass[12pt,a4paper,vi,draft]{sk-thesis}
\documentclass[12pt,a4paper,vi]{sk-thesis}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{a4paper, right=30mm, bottom=30mm, left=30mm, top=30mm}
\usepackage{ifdraft}
\usepackage{graphicx}
\setkeys{Gin}{draft=false} % disable hiding graphics in draft mode
\usepackage[table]{xcolor}
\usepackage{multicol, multirow}
\usepackage{amsmath, amssymb}
\usepackage{cmap}
\usepackage[T1]{fontenc}
\setlength {\marginparwidth }{2.5cm} 
\usepackage[obeyDraft]{todonotes}
\usepackage{booktabs, siunitx}
\usepackage[breaklinks=true]{hyperref}
\usepackage{natbib, breakcites}
\usepackage{bibentry}
\usepackage{doi}
\definecolor{navyblue}{rgb}{0.0, 0.0, 0.5}
%\definecolor{royalblue}{rgb}{0.06, 0.11, 0.42}
\hypersetup{
  final,
  colorlinks=true,
  urlcolor=navyblue,
  citecolor=navyblue,
  linkcolor=navyblue
}
\usepackage{cleveref}
\crefformat{footnote}{#2\footnotemark[#1]#3}
\usepackage{catoptions}
\input{Autoref.tex}
\usepackage{textcomp}
\usepackage{fancyhdr}
\newcommand{\changefont}{%
    \fontsize{10}{10}\selectfont
}
\fancyhf{}
%\fancyhead[LE]{\slshape \rightmark} %section
%\fancyhead[RE]{}
%\fancyhead[RO]{\slshape \leftmark} % chapter
%\fancyhead[LO]{}
\fancyhead[LE,RO]{\changefont \slshape \nouppercase{\rightmark}} %section
\fancyhead[RE,LO]{\changefont \slshape \nouppercase{\leftmark}} %chapter
\fancyfoot[C]{\thepage} %footer
\usepackage{datetime}
\usepackage[automake,toc]{glossaries}
\glsenablehyper
\makeglossaries
%\usepackage{comment}
\usepackage{subcaption}
\usepackage{tabularx, lscape, rotating}
\usepackage[most]{tcolorbox}
\newtcolorbox{myframe}[1][]{
  enhanced,
  top=12pt,bottom=12pt,left=16pt,right=16pt,
  arc=0pt,
  outer arc=0pt,
  colback=white,
  boxrule=1pt,
  #1
}
%%%%%%%%%%%% EPIGRAPH
\usepackage{epigraph}
%\setlength{\beforeepigraphskip}{1.0\baselineskip}
\setlength{\epigraphrule}{0pt}
\setlength{\epigraphwidth}{.4\textwidth}
%\setlength{\afterepigraphskip}{.25\baselineskip}
\renewcommand{\textflush}{flushepinormal}
    
\ifdraft{
    %% LIMIT CHAPTERS
    \includeonly{
        prelude,
        contents,
        chapters/introduction,
        chapters/background,
        chapters/thesis-objectives,
        chapters/conclusion,
        glossary,
        bibliography,
        chapters/appendix-a
    }
}{
}
\begin{document}
\ifdraft{
    %%%%%%%%%%% HEADERS AND FOOTERS
    \fancypagestyle{plain}{%
      \fancyhf{}%
      \renewcommand{\headrulewidth}{0pt}% Line at the header invisible
      \fancyfoot[L]{\changefont PhD Thesis - Student Name} % DRAFT ONLY
      \fancyfoot[C]{\thepage}% \changefont 
      \fancyfoot[R]{\changefont \textbf{DRAFT} \today} % DRAFT ONLY
    }
    \fancyfoot[L]{\changefont PhD Thesis - Student Name} % DRAFT ONLY
    \fancyfoot[R]{\changefont \textbf{DRAFT} \today} % DRAFT ONLY
    \pagestyle{fancy}
    
    %% SIMPLE TITLE PAGE
    \include{prelude}
}{
    %% FULL TITLE PAGE
    \include{cover}
    
    %%%%%%%%%%% HEADERS AND FOOTERS
    \fancypagestyle{plain}{%
      \fancyhf{}%
      \renewcommand{\headrulewidth}{0pt}% Line at the header invisible
      \fancyfoot[C]{\thepage}%
    }
    \pagestyle{fancy}
}
\include{contents}
\include{chapters/introduction}
\include{chapters/background}
\include{chapters/thesis-objectives}
\include{chapters/conclusion}
\include{glossary}
\include{bibliography}
\appendix
\include{chapters/appendix-a}
\end{document}