\typeout{TCI Document Style `sw20utah' <1 July 1994>.}
\typeout{NOTICE:  This macro file is NOT proprietary and may be 
freely copied and distributed.}
\input tcilcomm.tex
\input ulem.sty
%
\input thmsupp.tex %TCI theorem option support
%
\@twosidefalse
%
\setlength{\oddsidemargin}{.6in}
\setlength{\evensidemargin}{.6in}
\setlength{\textwidth}{5.8in}
\setlength{\topmargin}{-30pt}
\setlength{\leftmargin}{0in}
\setlength{\textheight}{8.95in}
\def\baselinestretch{2}


\def\listfigurename{LIST OF FIGURES}
\def\listtablename{LIST OF TABLES}

\def\singlespace{\def\baselinestretch{1}\large\normalsize}
\def\doublespace{\def\baselinestretch{2}\large\normalsize}
%
% JCS - added uppercase to title.
% JCS - added uppercase to author.
%

\newfield{thesistitle}{Title:}
\newfield{thesisauthor}{Author:}
\newfield{degreename}{Degree:}
\newfield{Dept}{Department:}
\newfield{Month}{Month:}
\newfield{Year}{Year:}
\newfield{thelistoffigures}{The List of Figures}
\newfield{thelistoftables}{The List of Tables}
\newfield{preface}{Preface}
\newfield{toc}{Table of Contents: }
\newfield{lof}{List of Figures: }
\newfield{lot}{List of Tables: }


\def\@do@thesistitle{}
\def\@do@thesisauthor{}
\def\@do@degreename{}
\def\@do@Dept{}
\def\@do@Month{}
\def\@do@Year{}

\def\titlepage{%
	\null\vfil
	\thispagestyle{empty}
    \pagenumbering{roman}
    \begin{center}
         {\expandafter\uppercase\expandafter{\the@thesistitle}}
    \end{center}
	\vskip 1in
    \begin{center}
        by\\[5mm]
        {\the@thesisauthor}
    \end{center}
	\def\baselinestretch{1}\large\normalsize
    \vskip 1 in 
    \begin{center}
      A Thesis submitted to the faculty of\\
      The University of Utah\\
      in partial fulfillment of the requirements for the degree of\\[1in]%
      \the@degreename
    \end{center}
	\vfil\vfil
	\def\baselinestretch{2}\large\normalsize
	\begin{center}
      Department of \the@Dept\\
	  The University of Utah \\
	  \the@Month \the@Year
	\end{center}
}

\def\copyrightpage{%
    \newpage
	\thispagestyle{empty}
	\null
	\vfil
	\begin{center}
	   Copyright \copyright \the@thesisauthor \the@Year\\
	   All Rights Reserved
	\end{center}
}

\def\generalabstract{%
      \newpage
      \pagestyle{plain}%
	  \thispagestyle{empty}
	  \setcounter{page}{4}
	  \null
      \begin{center} 
         ABSTRACT 
      \end{center}
	  \addcontentsline{toc}{chapter}{ABSTRACT}
      \vskip 24pt}

\def\@do@thelistoffigures{%
       \newpage\null
       \begin{center} LIST OF FIGURES \end{center}
	   \vskip 24pt
       \@starttoc{lof}       
       \addcontentsline{toc}{chapter}{LIST OF FIGURES}
}
%
\def\@do@thelistoftables{%
       \newpage\null
       \begin{center} LIST OF TABLES \end{center}
	   \vskip 24pt
       \@starttoc{lot}%
       \addcontentsline{toc}{chapter}{LIST OF TABLES}  
}
%                 
\def\acknowledgments{%
      \newpage
      \thispagestyle{empty}
	  \null
      \begin{center} ACKNOWLEDGMENTS \end{center}%
	  \addcontentsline{toc}{chapter}{ACKNOWLEDGMENTS}
      \vskip 24pt
}
      

\setcounter{tocdepth}{1}
\setcounter{secnumdepth}{2}
%
\def\@do@thetableofcontents{%
      \newpage\null
	  \begin{center} CONTENTS \end{center}
	  \vskip 24pt
      \@starttoc{toc}
      \addtocontents{toc}{\protect{\singlespace}}%
}
%
% 
\let\para\par

\def\firstchapter{%
       \pagestyle{myheadings}
       \pagenumbering{arabic}
       \addtocontents{toc}{\protect{\addvspace{12pt}}} 	   
	   \addtocontents{toc}{\protect{\noindent{Chapter}\para}}	   
       \def\firstchapter{\relax}}
%
\def\@makechapterhead#1{%
      \null
      \begin{center} 
        CHAPTER \thechapter\\
        #1
	  \end{center}
      \nobreak
}


\def\l@chapter#1#2{%
   \addpenalty{-\@highpenalty}%
   \vskip 1.0em plus\p@
   \@tempdima 1.5em
   \begingroup
     \parindent \z@ \rightskip \@pnumwidth
     \parfillskip -\@pnumwidth
     \bf
     \leavevmode
     \advance\leftskip\@tempdima
     \hskip -\leftskip
     #1\nobreak\dotfill \nobreak\hbox to\@pnumwidth{\hss #2}\par
     \penalty\@highpenalty
   \endgroup}


\def\@chapter[#1]#2{%
        \newpage\thispagestyle{empty}
        \firstchapter
        \ifnum \c@secnumdepth >\m@ne
           \refstepcounter{chapter}%
           \typeout{\@chapapp\space\thechapter.}%
           \addcontentsline{toc}{chapter}
                    {\protect\numberline{\thechapter}#1}
		   \addtocontents{toc}{\protect{\addvspace{12pt}}}	
        \else
           \addcontentsline{toc}{chapter}{#1}
        \fi
        \chaptermark{#1}%
        \addtocontents{lof}%
             {\protect\addvspace{10\p@}}% Adds between-chapter space
        \addtocontents{lot}%
             {\protect\addvspace{10\p@}}% to lists of figs & tables.
        \@makechapterhead{#2}%
        \@afterheading
}


%
% Here we define a new version of \@startsection which is just like the 
% original but uses a new version of \@sect (defined next).  A section 
% defined with this macro will have its heading underlined.
%     
\def\@ULstartsection#1#2#3#4#5#6{%
   \if@noskipsec \leavevmode \fi
   \par \@tempskipa #4\relax
   \@afterindenttrue
   \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
   \if@nobreak \everypar{}\else
     \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi \@ifstar
     {\@ULssect{#3}{#4}{#5}{#6}}{\@dblarg{\@ULsect{#1}{#2}{#3}{#4}{#5}{#6}}}}
%
\def\@ULsect#1#2#3#4#5#6[#7]#8{%
       \ifnum #2>\c@secnumdepth
           \let\@svsec\@empty
       \else
           \refstepcounter{#1}
           \edef\@svsec{\csname the#1\endcsname\hskip 1em}
       \fi
       \@tempskipa #5\relax
       \ifdim \@tempskipa>\z@
         \begingroup
             #6\relax 
             \@hangfrom{\hskip #3\relax\ULine{\@svsec}}%
             {\interlinepenalty \@M\ULine{#8}\par}%
         \endgroup
         \csname #1mark\endcsname{#7}
         \addcontentsline
             {toc}{#1}
             {\ifnum #2>\c@secnumdepth 
              \else
                \protect\numberline{\csname the#1\endcsname}%
              \fi #7}
      \else
         \def\@svsechd{\hskip #3\relax  %% \relax added 2 May 90
                  \ULine{\@svsec}\ULine{#8}\csname #1mark\endcsname
                      {#7}\addcontentsline
                             {toc}{#1}
                             {\ifnum #2>\c@secnumdepth \else
                                  \protect\numberline{\csname the#1\endcsname}%
                              \fi#7}}
      \fi
      \@xsect{#5}}
%   
\def\@ULssect#1#2#3#4#5{\@tempskipa #3\relax
   \ifdim \@tempskipa>\z@
     \begingroup #4\@hangfrom{\hskip #1}{\interlinepenalty \@M \ULine{#5}\par}\endgroup
   \else \def\@svsechd{#4\hskip #1\relax \ULine{#5}}\fi
    \@xsect{#3}}
%
\def\section{\@ULstartsection {section}{1}{\z@}{12pt plus .1ex minus
    .1ex}{12pt plus.2ex}{\centering\reset@font\normalsize}}
\def\subsection{\@ULstartsection{subsection}{2}{\z@}{12pt plus .1ex
    minus .2ex}{0pt plus.1ex}{\reset@font\normalsize}}
\def\subsubsection{\@ULstartsection{subsubsection}{3}{\z@}{-3.25ex plus
 -1ex minus-.2ex}{-1.5ex plus-.2ex}{\reset@font\normalsize}}

% The next two should not be used in this style.
\def\paragraph{\@startsection
     {paragraph}{4}{\z@}{3.25ex plus1ex minus.2ex}{-1em}{\reset@font
     \normalsize}}
\def\subparagraph{\@startsection
     {subparagraph}{5}{\parindent}{3.25ex plus1ex minus
     .2ex}{-1em}{\reset@font\normalsize}} 

       
\def\appendix{%
       \newpage
	   \addtocontents{toc}{\protect{\addvspace{12pt}}} 
	   \addtocontents{toc}{\protect{\noindent{Appendices}\para}}
 	   	     % Previous sections were not numbered - start now.
	   \setcounter{section}{0}
	   \setcounter{secnumdepth}{1}
	   \def\thesection{\Alph{section}.}
       \def\theequation{\thesection\arabic{equation}}
}
%
\def\thebibliography#1{%
       \newpage\null
       \begin{center} REFERENCES \end{center}
       \vskip 24pt
	   \addtocontents{toc}{\protect{\addvspace{12pt}}} 
	   \addcontentsline{toc}{chapter}{REFERENCES}
       \def\baselinestretch{1}\large\normalsize
       \list{}
            {\labelwidth 0pt%
             \leftmargin 1.5em
             \itemindent -1.5em
		     \usecounter{enumiv}%
             \let\p@enumiv\@empty
             \def\theenumiv{\arabic{enumiv}}%
                         }%
       \def\newblock{\hskip .11em plus.33em minus.07em}%
       \sloppy
       \clubpenalty4000
       \widowpenalty4000
       \sfcode`\.=\@m}

\def\endthebibliography{%
  \def\@noitemerr{\@warning{Empty `thebibliography' environment}}%
  \endlist
  \def\baselinestretch{2}\large\normalsize
}


\def\quote{\list{}{\rightmargin\leftmargin}\item[]
\def\baselinestretch{1}\large\normalsize}
\def\endquote{%
       \endlist
       \def\baselinestretch{2}\large\normalsize}


%
\parindent 20pt



\long\def\@footnotetext#1{%
       \insert\footins{%
          \reset@font
          \footnotesize
          \interlinepenalty\interfootnotelinepenalty
          \splittopskip
          \footnotesep
          \splitmaxdepth \dp\strutbox 
          \floatingpenalty \@MM
          \hsize\columnwidth 
          \@parboxrestore
          \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}
          \@makefntext
          {\rule{\z@}{\footnotesep}
           \ignorespaces
           \baselineskip 12pt #1\strut}%
        }%
}

% No feet
\def\@oddfoot{}
\def\@evenfoot{}

% Page number in upper right.
\def\@evenhead{\hfill\rm \thepage}% Left heading.
\def\@oddhead{\hfil \rm\thepage}%   Right heading.
