%%% -*-LaTeX-*-

%%% ====================================================================
%%% This file contains a small set of changes the venerable uuthesis
%%% support for LaTeX-2e to adjust page dimensions to the even worse
%%% typography of the 2010--2011 University of Utah thesis guidelines,
%%% sigh...
%%% [22-Aug-2013] -- update for 2013 specifications on page 24 if
%%%                  http://gradschool.utah.edu/thesis/wp-content/uploads/2013/08/2013-fall-handbook.pdf
%%% [25-Mar-2011]
%%% ====================================================================

\immediate \write16 {====================================================================================================}
\immediate \write16 {uuthesis-2016.sty version 0.03 <February 11, 2016>}
\immediate \write16 {WARNING: the page dimension changes are experimental, and subject to change!}
\immediate \write16 {PLEASE: report to the uuthesis maintainers any further modifications demanded by the UofUtah Thesis Office}
\immediate \write16 {====================================================================================================}

\textheight		= 8.65in
\textwidth 		= 6in

\oddsidemargin		= 0.25in
\evensidemargin		= 0.25in

\topskip		= 0.0in
\topmargin		= 0.0in
\headheight		= 0.0in
\headsep		= 24pt

\footskip		= 0.0in

\flushbottom

\voffset                = 0in
\textheight		= 8.65in

\addtolength{\voffset}   {-20pt}
\addtolength{\textheight}{+20pt}

%The following are the 2016 changes

\def\HFsectionSKIP{36.5pt}
\def\fixchapterheading{\vspace{-36.5pt}}

\def\frontmatterformat{%
  \pagestyle{plain}%
  \pagenumbering{roman}%
  \global\c@page = -1
  \parskip 0pt
}

\def\tableofcontents{\newpage
  \thispagestyle{empty}
  \mainheading{CONTENTS}
  \vskip -1pt
  \par\removelastskip\singlespace\par\removelastskip% GBG Oct 1993
  \vskip 5pt
  \@starttoc{toc}
  \ifnoisy \typeout{Contents.} \fi
}



\def\@chapter[#1]#2{\clearpage
  \thispagestyle{empty}%
  \global \@topnum \z@
  \if@oneappendix% Different treatment for one appendix
           \ifnoisy \typeout{\@chapapp:} \fi
           \refstepcounter{chapter}
           \addcontentsline{toc}{chapter}{\thesisTOC{\@chapapp: #1}}%
           \mainheading{\@chapapp}%
  \else
    \ifnum \c@secnumdepth >\m@ne\relax
      \refstepcounter{chapter}
% If chapter==1 or chapter==A, then TOC gets header
      \edef\@tmp{\thechapter}
      \ifx\@tmp\@optionA
        \addcontentsline{toc}{groupheader}{APPENDICES}%
      \fi
      \ifx\@tmp\@optionONE
        \addtocontents{toc}{\protect\vspace*{-4pt}}
        \addcontentsline{toc}{groupheader}{CHAPTERS}
      \fi
        \addcontentsline{toc}{chapter}%
        {\protect\numberline{\thechapter.}\thesisTOC{#1}}%
        \addcontentsline{toc}{groupheader}{\protect\vspace{-22pt}}
    \else
       \addcontentsline{toc}{chapter}{\thesisTOC{#1}}%
    \fi
    \ifnoisy \typeout{\@chapapp\space\thechapter.} \fi
    \mainheading{\@chapapp\space\thechapter}
  \fi
  \mainheadingtext{#2}{\HFchapter\bfseries}% Text=boldface chapter header font
  \vskip \HFchapterSKIP
  \nobreak\@afterheading\global\@nobreakfalse
}

\def\maintext{
  \newpage
  \normalspace
  \pagestyle{myheadings}
  \markright{}
  \pagenumbering{arabic}
  \parskip 0pt
}

\def\listoffigures{
  \iflistoffigures
    \newpage
    \thispagestyle{empty}
    \addcontentsline{toc}{chapter}{LIST OF FIGURES}
    \mainheading{LIST OF FIGURES}\vskip 12.5pt
    \ifnoisy \typeout{List of Figures.} \fi
    \noindent{Figures}\hfill{Page}
    \@starttoc{lof}
  \else
    \ifnoisy \typeout{No list of figures.} \fi
  \fi
} 

\def\listoftables{
  \iflistoftables
    \newpage
    \thispagestyle{empty}
    \addcontentsline{toc}{chapter}{LIST OF TABLES}
    \mainheading{LIST OF TABLES}\vskip 12.5pt
    \ifnoisy \typeout{List of Tables.} \fi
    \noindent{Tables}\hfill{Page}
    \@starttoc{lot}
  \else
    \ifnoisy\typeout{No list of tables.}\fi
  \fi
}