%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  THESIS DOCUMENT SUBSTYLE
%%   
%%
%%     Copyright Research Computing Facility
%%               Department of Mathematics and Statistics,
%%               University of Massachusetts/Amherst
%%
%%     Makes adjustments to the basic REPORT document style;  page layout
%%     slightly oriented toward REP12 point size substyle.
%%     Some of this is also adapted from 'latex.tex', which is a good
%%     source if you're looking for what all this means, since it's
%%     mildly documented. Also consider lfonts.???
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%     v. Mar 2007

\long\def\comment#1{}
\comment{

  Example of use:
    \documentstyle[12pt,umthesis]{report}
    \begin{document}
    \title{How to Write Theses\\
            With Two Line Titles}
    \author{John Henry Candidate}
    \committeechair{John Parker}
    \firstreader{Jane Green}
    \secondreader{John BigBooty}
    \outsidereader{John Nomath\\(Another Department)}
    \beforepreface
    \dedicationsection{Dedication}
    \prefacesection{Acknowledgements}
        I would like to thank...
    \prefacesection{Abstract}
        TITLE\\....
    \afterpreface
 
    \chapter{Introduction}
         ...
    \chapter{Conclusions}
         ...
    \appendix
    \chapter{A Long Proof}
         ...
    \begin{thebibliography}[99]
         ...
    \end{thebibliograpgy}
    \end{document}

Documentation:
    This style file modifies the standard report style to follow the
    Graduate School's ``Typing Guidelines for Master's Theses and
    Doctoral Dissertations''.  
    It sets the margins, interline spacing,  the figure
    and table numbering style, and disallows page breaks at hyphens.

    The \beforepreface command creates the title page, a copyright page
    (optionally), and a signature page.  Then the user can put a
    dedication page, using the \dedicationsection, and
    acknowledgments and an abstract using the \prefacesection 
    command.  The \afterpreface command then produces the tables of
    contents, tables and figures, and sets things up to start
    the main body (on arabic page 1).
    
    The following commands can control what goes in the front matter
    material:
    
        \title{thesis title}
        \author{author's name}
        \dept{author's department}
                - Mathematics and Statistics if omitted
        \committeechair{the principal advisor's name}
        \firstreader{the first reader's name}
        \secondreader{the second reader's name}
        \outsidereader{the outside reader's name}
        \submitdate{month year in which submitted to GPO}
                - date LaTeX'd if omitted
        \copyrightyear{year degree conferred (next year if submitted in Dec.)}
                - year LaTeX'd (or next year, in December) if omitted
        \copyrighttrue or \copyrightfalse
                - produce or don't produce a copyright page (true by default)
        \figurespagetrue or \figurespagefalse
                - produce or don't produce a List of Figures page
                  (true by default)
        \tablespagetrue or \tablespagefalse
                - produce or don't produce a List of Tables page
                  (true by default)

This style uses interline spacing that is 1.7 times normal, except
in the figure and table environments where normal spacing is used.
That can be changed by doing:
    \renewcommand{\baselinestretch}{1.9}
(or whatever you want instead of 1.9)
Unfortunately, that command probably won't take effect unless it comes
before the \begin{document} or after something like \small \normalsize.
This has been incorporated into the environments
 \beginsinglespace                  \begindoublepage
  .............                       ...........
 \endsinglespace                    \enddoublespace

The example above shows the 12pt substyle being used.  This seems to give
acceptable looking results, but it may be omitted to get smaller print.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  More techically, this (re-)defines :
%%
%%  \danger and \ddanger as in the TeX book    ; ve.)
%%  defaults (fonts, mathsubscripts, etc.)
%%  page layout (heigths, widths, lengths ...)
%%  figures and tables so that they are numbered accross chapters and
%%                      have bold captions 
%%  chapter/section/subsection titles and entries in the .toc 
%%  soloappendix (if there is only one)
%%  table of contents, list of fig/tab to conform to Grad School
%%                      format (single spacing)
%%  theorem environment so that text is not slanted
%%  double/single spacing  (\baselinestretch)
%%  bibliography (single spacing)
%%  figure/table captions (floating stuff) single spaced
%%  footnotes single spaced
%%  pagestyles  (thesis,draft,preliminary,draftpreliminary)
%%  penalties
%%  new variables (\dept and the like)
%%  \beforepreface    
%%      \titlep(age)
%%      \copyrightpage
%%      \signaturepage
%%  \dedicationsection
%%  \prefacesection
%%  \afterpreface
%%      \tableofcontents (with modifications)
%%      \listoftables    (with modifications)
%%      \listoffigures   (with modifications)                         ; ve.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}

\typeout{         }
\typeout{UMTHESIS style file, RCF, Math Dept UMass Amherst, 03-18-2007; dc ve gk}
\typeout{         }

\makeatletter   % Make '@' a letter to allow access to private macros of
                %   LaTeX and Plain TeX.  

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  Temporary register
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newdimen\@myowntempdimen

%%%%%%   
%%      DANGER and Double danger signs as the TeX manual defines them.
%%      (commands \danger & \ddanger as on page 419, The TeX Book.)
%
%% First load nesessary symbols : (Metafont logo and spec. symbols)
%
\font\manual=manfnt
%
%% Define \danger environment
%
\def\dbend{{\manual\char127}} % ``dangerous bend'' sign
\def\d@nger{\medbreak\begingroup\clubpenalty=10000
  \def\par{\endgraf\endgroup\medbreak} \noindent\hang\hangafter=-2
%  \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ninepoint} % Dunno ninepoint.
  \hbox to0pt{\hskip-\hangindent\dbend\hfill}}
\outer\def\danger{\d@nger}
\def\dd@nger{\medbreak\begingroup\clubpenalty=10000
  \def\par{\endgraf\endgroup\medbreak} \noindent\hang\hangafter=-2
%  \hbox to0pt{\hskip-\hangindent\dbend\kern1pt\dbend\hfill}\ninepoint} %dito
  \hbox to0pt{\hskip-\hangindent\dbend\kern1pt\dbend\hfill}}
\outer\def\ddanger{\dd@nger}
\def\enddanger{\endgraf\endgroup} % omits the \medbreak
%%
%% For documentation look at latex.tex.


%%%%%%
%%      At some point the Grad School had complained that sub- and
%%      superscripts were too small. Consequently, somebody re-defined
%%      most font assignments along the lines of the TeX Book
%%      (p.414ff) in order to alleviate this. 
%%      
%%      Since the New Font Selection Scheme (NFSS) completely
%%      re-organizes the way LaTeX accesses fonts, this didn't work
%%      any more, but gave symbols instead of letters (which is
%%      actually quite nice to illustrate that math is a lingua
%%      sacra). After browsing through most of the NFSS related files
%%      (lfonts.sty, fontsdef.ori ...) it became clear that Mittlebach
%%      and Sch\"opf had thought about that that, and provided a nice
%%      solution with the \define@mathsizes{12}{8}{6}; it says if the
%%      font used is from the twelve point size font file, use
%%      subscripts of size 8pt and subsubscripts of size 6pt.
%%      
%%      I copied the defaults section from  (lfonts.sty -- presently
%%      in /usr/local/lib/tex/inputs )
%
% Assign actual sizes to variables (To be removed.)
% \def\normalsize{\@normalsize}
% \def\@vpt{5}
% \def\@vipt{6}
% \def\@viipt{7}
% \def\@viiipt{8}
% \def\@ixpt{9}
% \def\@xpt{10}
% \def\@xipt{11}
% \def\@xiipt{}  % This makes nice symbol soup :)
% \def\@xiipt{12}
% \def\@xivpt{14}
% \def\@xviipt{17}
% \def\@xxpt{20}
% \def\@xxvpt{25}
%
% Corresponding math font sizes (normal, subscript, subsubscript)
% \define@mathsizes{5}{5}{5}
% \define@mathsizes{6}{5}{5}
% \define@mathsizes{7}{6}{5}
% \define@mathsizes{8}{6}{5}
% \define@mathsizes{9}{6}{5}
% \define@mathsizes{10}{7}{5}
% \define@mathsizes{11}{7}{5}
% \define@mathsizes{12}{8}{6}
%\define@mathsizes{14}{10}{7}
%\define@mathsizes{17}{12}{10}
%\define@mathsizes{20}{14}{12}
% \define@mathsizes{25}{20}{17}
%% 
%%
%%%%%%


%%%%%%
%%  Page layout  (modification of 'rep12.sty')

\def\ds@twocolumn
       {\@warning{Two-column option not available in THESIS page layout}}

\oddsidemargin   39pt
\textwidth      422pt
\evensidemargin   0pt  %%% Binding edge 1 inch
\topmargin       -1pt  %%% changed from the orginal 8pt, then 3pt
\headheight      12pt
\headsep         10pt  %%% changed from the original 26pt
\textheight     630pt  %%% changed from the original 602pt
%\footheight      12pt
%\footskip        44pt  %%% changed from 37pt
\footskip       0.46in %%% calculated as follows to produce page
                       %%% numbers which are 1/2 inch from bottom of
                       %%% page 
% \footskip=\pageheight(11in)-\textheight-\headsep-\headheight-topmargin-1.5in

\columnwidth         \textwidth 
\columnsep        0pt
\columnseprule    0pt

%%  Margin notes
\marginparwidth 0.0truein
\marginparsep   0.0truein
\marginparpush  0.0truein

%%  Footnotes
\skip\footins   12pt plus 2pt minus 1pt
\footnotesep    12pt

%%  Double/single spacing is defined further down.
%\renewcommand{\baselinestretch{1.7}}

%%%%%%
%%  Figures and Tables (modification of \@makecaption in 'report.sty'
%%                      and \@caption in latex.tex) 
%%    - includes redefinition of ``figure'' and ``table'' so that
%%      figures and tables are numbered across chapter boundaries (not
%%      really needed at UMass...)
%%
%%    - NOTE: The counter associated with figures is now ``figureacross'' and
%%            that with tables is now ``tableacross''.
%%
%%    - NOTE: THIS CHANGE MIGHT SCREW UP TWO-COLUMN FIGURES AND TABLES
%%
%%    - NOTE: Captions are changed to bold face.
%%

\long\def\@makecaption#1#2{
   \vskip 10pt 
   \setbox\@tempboxa\hbox{\bf#1. #2}      % Use boldface...
   \ifdim \wd\@tempboxa >\hsize           % IF longer than one line:
       \setbox\@tempboxa\hbox{\bf#1.\ }   %   THEN indent TITLE (boldface)
       \@myowntempdimen=\hsize
         \advance\@myowntempdimen-\wd\@tempboxa
         \advance\@myowntempdimen-2em
       \hbox to\hsize
          {\hfil\box\@tempboxa \parbox[t]
          {\@myowntempdimen}{\bf#2}\hfil} % Use boldface...
     \else                                %   ELSE  center.
       \hbox to\hsize{\hfil\box\@tempboxa\hfil}  
   \fi}

% Put spacing information into the list of fig/tab
\long\def\@caption#1[#2]#3{
  \addtocontents{\csname ext@#1\endcsname}
                {\protect\addvspace{12pt}}
  \addcontentsline{\csname ext@#1\endcsname}{#1}
     {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}
  \par
  \begingroup
    \@parboxrestore
    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup}

\newcounter{figureacross}
\def\thefigureacross{\@arabic\c@figureacross}

\def\fps@figureacross{tbp}
\def\ftype@figureacross{4}
\def\ext@figureacross{lof}
\def\fnum@figureacross{Figure \thefigureacross}
\def\figure{\@float{figureacross}}               %% redefinition of ``figure''
\let\endfigure\end@float


\newcounter{tableacross}
\def\thetableacross{\@arabic\c@tableacross}

\def\fps@tableacross{tbp}
\def\ftype@tableacross{8}
\def\ext@tableacross{lot}
\def\fnum@tableacross{Table \thetableacross}
\def\table{\@float{tableacross}}                %% redefinition of ``table''
\let\endtable\end@float


%%%%%%
%%  Section Titles
%%  Altered so that the word `chapter', the chapter number, and title are all
%%  set in \Large type.  The section headings are  \large.  This is
%%  acceptable to the grad school, and makes the capters easier to find.  
%%%%%%
\def\thechapter       {\arabic{chapter}}
\def\thesection       {\thechapter.\arabic{section}}
\def\thesubsection    {\thesection.\arabic{subsection}}

\def\@chapapp{{\bf C\ H\ A\ P\ T\ E\ R}}
\def\@chapappclear{CHAPTER}

\def\@makechapterhead#1{               % Heading for \chapter command
  \vspace*{30pt}                       % Space at top of text page.
  \begin{center}
    \ifnum \c@secnumdepth >\m@ne
      \Large
 \@chapapp{}\hspace{1.5em}{\bf\thechapter}\\  % 'Chapter' and number (Large)
      \vskip 15pt                        %  Space between number and title.
    \fi
    \Large                               % VE
    #1
% Automatic uppercase leads to problems with ``small math''
%    {\uppercase\expandafter{#1}}         % Title in uppercase
  \end{center}\par                       
  \nobreak                             % TeX penalty to prevent page break.
  \vskip 30pt                          % Space between title and text.
  }

\def\@makeschapterhead#1{              % Heading for \chapter* command
  \vspace*{30pt}                       % Space at top of page. (as above)
  \begin{center}
    \Large 
    #1
% Automatic uppercase leads to problems with ``small math''
%      {\uppercase\expandafter{#1}}
  \end{center}\par
  \nobreak                             % TeX penalty to prevent page break.
  \vskip 30pt                          % Space between title and text.
  }

\def\chapter{\cleardoublepage   % Starts new page; makes it odd if two sided
   \thispagestyle{plain}        % Page style of chapter page is 'plain' may 
                                % be changed to 'empty' if you do not
                                % want a number on the display page. 
   \global\@topnum\z@           % Prevents figures from going at top of page.
   \@afterindenttrue
   \secdef\@chapter\@schapter} 

\def\@chapter[#1]#2{
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{chapter}
      \typeout{\@chapappclear\space\thechapter.}
      \ifnum\c@chapter=\@ne
        \addtocontents{toc}{\protect\addvspace{10pt}}
        \addtocontents{toc}
%            {{\protect\noindent\protect\uppercase\expandafter{\@chapappclear}}}
%   removed \uppercase so that the word Chapter in the toc would not
%   be all caps -- MLS
            {{\protect\noindent\protect\expandafter{\@chapappclear}}}
      \fi
      \addcontentsline{toc}
         {chapter}{\protect\numberline{\thechapter.}{#1}}
%         {chapter}{\protect\numberline{\thechapter.}{\protect\uppercase\expandafter{#1}}}
   \else
      \addcontentsline{toc}{chapter}{{#1}}
%      \addcontentsline{toc}{chapter}{{\protect\uppercase\expandafter{#1}}}
   \fi
   \chaptermark{#1}
   \if@twocolumn                           % Tests for two-column mode.  
           \@topnewpage[\@makechapterhead{#2}]  
     \else \@makechapterhead{#2}
           \@afterheading                  % Routine called after chapter and
     \fi}                                  % section heading.


\def\section{\ifnum \c@section=\z@         % If first section of a chapt.
%% then separate it from the chapter heading by 6pt
                \addtocontents{toc}{\protect\addvspace{.75\baselineskip}} 
%% otherwise :
             \else
                \ifnum \c@subsection>\z@
                \addtocontents{toc}{\protect\addvspace{.75\baselineskip}}
                \else
                \addtocontents{toc}{\protect\addvspace{0pt}}
                \fi
             \fi
             \@startsection{section}{1}
                {\z@}{6.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
                { \large\bf}}              % Section title font
                                           % VE: down from \Large 
                                                
\def\subsection{\ifnum \c@subsection=\z@
                  \addtocontents{toc}{\protect\addvspace{.75\baselineskip}} %VE
                \else
                  \addtocontents{toc}{\protect\addvspace{0pt}} %VE
                \fi
                \@startsection{subsection}{2} 
                   {\z@}{3.25ex plus 1ex minus .2ex}{1.5ex plus
.2ex}{\sl\bf}}  % \bf instead of \large VE
\def\subsubsection{\@startsection{subsubsection}{3}
                {\z@}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}{\sl}}
\def\paragraph{\@startsection{paragraph}{4}
                {\parindent}{\z@}{-1em}{\sl}}
\def\subparagraph{\@startsection{subparagraph}{4}
                {\parindent}{\z@}{-1em}{\sl}}

\def\appendix{\par
  \setcounter{chapter}{0}
  \setcounter{section}{0}
  \def\@chapapp{{\bf A\ P\ P\ E\ N\ D\ I\ X}}
%  \def\@chapappclear{APPENDIX}
  \def\@chapappclear{APPENDICES}        %% MLS 032796
  \def\thechapter{\Alph{chapter}}

  \def\@chapter[##1]##2{                %%   
    \ifnum \c@secnumdepth >\m@ne        %%   
       \refstepcounter{chapter}            %%   
       \typeout{\@chapappclear} 
       \ifnum\c@chapter=\@ne
          \addtocontents{toc}{\protect\addvspace{10pt}}
          \addtocontents{toc}{{\protect\noindent\protect\uppercase\expandafter{\@chapappclear}}}
%         \addtocontents{toc}{{\protect\newline}}       %% MLS 032696
       \fi
    \fi 
%    \addcontentsline{toc}{listintoc}{{\thechapter. ##1}}
    \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter.}{##1}}      %% MLS 032796
    \chaptermark{##1}
    \if@twocolumn                           % Tests for two-column mode.  
    \@topnewpage[\@makechapterhead{##2}]  
    \else \@makechapterhead{##2}
    \@afterheading                        % Routine called after chapter and
    \fi}                                  % section heading.
  \def\@makechapterhead##1{               % Heading for \chapter command
     \vspace*{30pt}                       % Space at top of text page.
     \begin{center}
       \ifnum \c@secnumdepth >\m@ne
      \Large
 \@chapapp{}\hspace{1.5em}{\bf\thechapter}\\  % 'Chapter' and number (Large)
         \vskip 15pt                      % Space between number and title.
       \fi
       {##1}                             % Title in uppercase
     \end{center}\par
     \nobreak                             % TeX penalty to prevent page break.
     \vskip 30pt                          % Space between title and text.
     }

}

\def\soloappendix{\appendix
%\def\soloappendix{\par
%  \setcounter{chapter}{0}
%  \setcounter{section}{0}
%  \def\@chapapp{{\bf A\ P\ P\ E\ N\ D\ I\ X}}
  \def\@chapappclear{APPENDIX}           %%   MLS 032796
  \def\thesection{\arabic{section}}      %%   Prevent chapter=appendix
                                         %%   number from appearing in
                                         %%   section number.

   \def\@chapter[##1]##2{                %%   Single appendix so redefine
     \ifnum \c@secnumdepth >\m@ne        %%     \@chapter not to put
        \refstepcounter{chapter}         %%     appendix number in TOC
        \typeout{\@chapappclear}
        \ifnum\c@chapter=\@ne
          \addtocontents{toc}{\protect\addvspace{10pt}}
          \addcontentsline{toc}{soloappendix}
            {\protect\numberline{\@chapappclear:}{##1}}
        \else
          \@warning{Should only be one appendix using \protect\soloappendix}
        \fi
     \else
        \addcontentsline{toc}{chapter}{\hspace{2ex}{##1}}
     \fi
     \chaptermark{##1}
     \if@twocolumn                           % Tests for two-column mode.  
           \@topnewpage[\@makechapterhead{##2}]  
     \else \@makechapterhead{##2}
           \@afterheading                 % Routine called after chapter and
     \fi}                                 % section heading.
  \def\@makechapterhead##1{               % Heading for \chapter command
     \vspace*{30pt}                       % Space at top of text page.
     \begin{center}
       \ifnum \c@secnumdepth >\m@ne
        \Large
         \@chapapp\\                      % 'Chapter', no number.
         \vskip 15pt                      % Space between number and title.
       \fi
       {##1}
%    {\uppercase\expandafter{##1}}        % Title in uppercase
%was: \sc ##1                            % Title.
     \end{center}\par
     \nobreak                             % TeX penalty to prevent page break.
     \vskip 30pt                          % Space between title and text.
     }}


%%%%%%
%%  Table of Contents, List of Figures, List of Tables
%
\def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else
  \vskip \z@ plus .2pt
  {\hangindent #2\relax \advance\hangindent 1em
    \rightskip \@tocrmarg \parfillskip -\rightskip
    \parindent #2\relax\@afterindenttrue
   \interlinepenalty\@M \leavevmode 
   \@tempdima #3\relax
    #4\leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep mu$}\hfill 
   \hbox to\@pnumwidth{\hfil\rm #5}\par}\fi}

\def\numberline#1{\advance\hangindent\@tempdima%
                               \hbox to\@tempdima{\hfil#1\ \ }}

\def\tableofcontents{
  \thispagestyle{plain}
  \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi
  \chapter*{TABLE OF CONTENTS\markboth{TABLE OF CONTENTS}{TABLE OF CONTENTS}}
  \@starttoc{toc}
%  \def\@colhead{Page}
%  \addcontentsline{toc}{textintoc}{\protect{\@colhead}}
  \if@restonecol\twocolumn\fi}

\def\l@chapter#1#2{\pagebreak[3] 
   \vskip 10pt            % space above chapter line
   \@tempdima 2.9em       % width of box holding chapter number
   \begingroup
     \hangindent 1em
     \parindent \z@ \rightskip \@pnumwidth \advance\rightskip 1em
     \parfillskip -\rightskip
     \leavevmode          % TeX command to enter horizontal mode.       
     \hspace*{1em}#1\leaders\hbox{$\m@th \mkern \@dotsep mu. \mkern \@dotsep mu$}
\hfill  \hbox to\@pnumwidth{\hss #2}\par
   \endgroup}
      
\def\l@section{\@dottedtocline{1}{4.5em}{2em}}
\def\l@subsection{\@dottedtocline{2}{7.0em}{2.5em}}
\def\l@subsubsection{\@dottedtocline{3}{10.0em}{3.0em}}
\def\l@paragraph{\@dottedtocline{4}{12.5em}{5.8em}}
\def\l@subparagraph{\@dottedtocline{5}{14.5em}{6.8em}}

\def\l@soloappendix#1#2{\pagebreak[3] 
   \vskip 10pt            % space above chapter line
   \@tempdima 6.3em       % width of box holding chapter number
   \begingroup
     \hangindent 0em
     \parindent \z@ \rightskip \@pnumwidth \advance\rightskip 1em
     \parfillskip -\rightskip
     \leavevmode          % TeX command to enter horizontal mode.       
     \hspace*{0em}#1\leaders\hbox{$\m@th \mkern \@dotsep mu. \mkern \@dotsep mu$}
\hfill  \hbox to\@pnumwidth{\hss #2}\par
   \endgroup}
      
%\def\l@soloappendix{\@dottedtocline{1}{0em}{6.1em}}

\def\listoffigures{
  \thispagestyle{plain}
  \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi
  \chapter*{LIST OF FIGURES\markboth{LIST OF FIGURES}{LIST OF FIGURES}}
  \addtocontents{toc}{\protect\addvspace{\baselineskip}}
  \addcontentsline{toc}{listintoc}{{LIST OF FIGURES }}
  \@starttoc{lof}
  \if@restonecol\twocolumn\fi}

\def\listoftables{
  \thispagestyle{plain}
  \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi
  \chapter*{LIST OF TABLES\markboth{LIST OF TABLES}{LIST OF TABLES}}
  \addtocontents{toc}{\protect\addvspace{\baselineskip}}
  \addcontentsline{toc}{listintoc}{{LIST OF TABLES }}
  \@starttoc{lot}
  \if@restonecol\twocolumn\fi}

\def\l@figure{\@dottedtocline{1}{0pt}{3em}}

\def\l@listintoc{\@dottedtocline{1}{0pt}{0pt}}
\let\l@figureacross\l@figure

\let\l@tableacross\l@figure

\def\l@textintoc{\protect{1}}

%    ****************************************
%    *         OTHER ENVIRONMENTS           *
%    ****************************************
%
%
% THEOREM 
% \@begintheorem ... \@endtheorem are the commands executed at the
% beginning and end of a (user-defined) theorem-like environment.
% Except \@opargbegintheorem is executed when an optional argument is
% given.  Cf. LATEX.TEX.  The difference to the LaTeX standard is that
% we don't want to use slanted (italic?) font.

% \def\@begintheorem#1#2{\trivlist \item[\hskip \labelsep{\bf #1\ #2}]}
% \def\@opargbegintheorem#1#2#3{\trivlist
%       \item[\hskip \labelsep{\bf #1\ #2\ (#3)}]}
% \def\@endtheorem{\endtrivlist}


%%%%%% ``Spacing''
%%
%%  Double: Use 1.7 times the normal baseline-to-baseline skip.
%%  Single: Use 1.0 times the normal baseline-to-baseline skip.
%%  Table : Use 0.8 times the normal baseline-to-baseline skip, for
%%          table of contents, list of figures, list of tables.
%%
%%  (Is activated either by \begin{document} or by a change of sizes
%%   (e.g. \small\normalsize), which has been incorporated into the
%%   \begin...space commands.)
%%
%%  We need single spacing for figure/table cations, footnotes and
%%  for the bibliography.
%%  The table of contents looks better with even less spacing...

%   \def\baselinestretch{1.7}\@normalsize       % TeX format
%   \renewcommand{\baselinestretch}{1.7}        % LaTeX format

\def\doublespace{\renewcommand{\baselinestretch}{1.7}}
\def\tablespace{\renewcommand{\baselinestretch}{0.8}}
\def\singlespace{\renewcommand{\baselinestretch}{1.0}}
%

\def\begindoublespace{\doublespace\small\normalsize}
\def\enddoublespace{}
\def\beginsinglespace{\singlespace\small\normalsize}
\def\endsinglespace{}
\def\begintablespace{\tablespace\small\normalsize}
\def\endtablespace{}
%

% Switch to double spacing now. 
\doublespace


%%      Redefine the macro used for floats (including figures and tables)
%%      so that single spacing is used.
%%      (Note \def\figure{\@float{figure}set single spacing} doesn't work
%%      because figure has an optional argument)

%% Fix from GT (RPI, thesis.cls)  03-18-2007 ve.

\let\latex@xfloat=\@xfloat
\def\@xfloat #1[#2]{%
  \latex@xfloat #1[#2]%
  \def \baselinestretch {1}\@normalsize  %%  GT: need \@normalsize?
  \normalsize
}

%% This part causes problems with the ``color'' package.
%% Commented out by ve, 03-18-2007
%% Fix above from GT (RPI, thesis.cls).   03-18-2007  ve

%% %% \def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
%% %%    \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
%% %%       \@parmoderr\@floatpenalty\z@
%% %%     \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
%% %%        \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
%% %%        \@tfor \@tempa :=#2\do
%% %%                         {\if\@tempa h\advance\@tempcnta \@ne\fi
%% %%                          \if\@tempa t\advance\@tempcnta \tw@\fi
%% %%                          \if\@tempa b\advance\@tempcnta 4\relax\fi
%% %%                          \if\@tempa p\advance\@tempcnta 8\relax\fi
%% %%          }\global\count\@currbox\@tempcnta}\@fltovf\fi
%% %%     \global\setbox\@currbox\vbox\bgroup 
%% %%     \beginsinglespace      % SINGLESPACE
%% %%     \hsize\columnwidth \@parboxrestore}
%%

%% Define footnotes to be single spaced (using TeX command)
%%
%  This is the change:                    |||||||||||||||||||||||
%                                         VVVVVVVVVVVVVVVVVVVVVVV
\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\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
      #1\strut}}}
%%

%%  Bibliography -- the (incomprehesible) core is identical to
%%  'report.sty'. Two major changes are made in the lines right at the
%%  top: 
%%  1) craft the ``Bibliography'' entry in the table of contents 
%%     (\addtocontents lines)
%%  2) switch to single spacing 
%%


\def\thebibliography#1{
  \chapter*{{\protect\bf BIBLIOGRAPHY}\markboth{BIBLIOGRAPHY}{BIBLIOGRAPHY}}
  \addtocontents{toc}{\protect\addvspace{10pt}}
  \addcontentsline{toc}{listintoc}{{BIBLIOGRAPHY}}

  \beginsinglespace        %% single spacing (needed for Bibliography)

% What follows is identical to 'report.sty'
  \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
   \advance\leftmargin\labelsep\usecounter{enumi}}
   \def\newblock{\hskip .11em plus .33em minus .07em}
   \sloppy\clubpenalty4000\widowpenalty4000
   \sfcode`\.=1000\relax}

% If you do NOT want your bibliography items labeled (be it with
% numbers, be it with names) in your Bibliography, replace 
%
%  {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
%   \advance\leftmargin\labelsep\usecounter{enumi}}}
%
% in above by 
%
%  {} {}
% 
% Does not apply to UMass Grad School Guidelines.... labels needed.

\let \endthebibliography=\endlist


%%%%%%
%%  Page Styles
%
% If you want to have something written on the top (or the bottom) of
% the page, e.g. the name of the chapter/section/subsection or your
% name or any funny comments or strange symbols or .... this is 
% the place to change this is 
%        \def\@oddhead{\rm YOURCOMMENTS\hfil\thepage}
%        \def\@evenhead{\rm\thepage\hfil YOURCOMMENTS}
%
% Observe that you have to change it in THAT section of the page 
% style definitions that you're actually using, e.g. 
% draft/thesis/preliminary/draftpreliminary
% Default appears to be the first, preliminary, which looks like the
% best one anyway.

\def\ps@preliminary
  {\def\@oddhead{}
   \def\@oddfoot{\rm \hfil\thepage\hfil}
   \let\@evenhead\@oddhead
   \let\@evenfoot\@oddfoot
   \def\ps@plain                                % For \thispagestyle{plain}
     {\def\@oddhead{}                           % such as chapter begin.
      \def\@oddfoot{\rm \hfil\thepage\hfil}
      \let\@evenhead\@oddhead
      \let\@evenfoot\@oddfoot}}


\def\ps@thesis
  {\def\@oddfoot{} 
   \def\@evenfoot{} 
   \def\@oddhead{\rm\hfil\thepage}
   \if@twoside 
        \def\@evenhead{\rm\thepage\hfil} 
   \else
        \let\@evenhead\@oddhead 
   \fi 
   \def\ps@plain 
      {\def\@oddhead{}
       \def\@oddfoot{\rm \hfil\thepage\hfil} 
       \let\@evenhead\@oddhead
       \let\@evenfoot\@oddfoot}}

\def\ps@draftpreliminary
  {\def\@oddhead{}
   \def\@oddfoot{\sl DRAFT\hspace{1em}\today
                 \rm \hfil\thepage\hfil
                 \sl \today\hspace{1em}DRAFT}
   \let\@evenhead\@oddhead
   \let\@evenfoot\@oddfoot
   \def\ps@plain
     {\def\@oddhead{}
      \def\@oddfoot{\sl DRAFT\hspace{1em}\today
                    \rm \hfil\thepage\hfil
                    \sl \today\hspace{1em}DRAFT}
      \let\@evenhead\@oddhead
      \let\@evenfoot\@oddfoot}}

\def\ps@draft
  {\def\@oddfoot{}
   \def\@evenfoot{}
   \def\@oddhead{\sl DRAFT\hspace{1em}\today \rm\hfil\thepage}
   \if@twoside
     \def\@evenhead{\rm\thepage\hfil\sl DRAFT\hspace{1em}\today}
   \else
     \let\@evenhead\@oddhead
   \fi
   \def\ps@plain
     {\def\@oddhead{}
      \def\@oddfoot{\sl DRAFT\hspace{1em}\today
                    \rm \hfil\thepage\hfil
                    \sl \today\hspace{1em}DRAFT}
      \let\@evenhead\@oddhead
      \let\@evenfoot\@oddfoot}}


%%%%%%
%%  Variables for department name, committee members etc. if not
%%  already defined (e.g. \author \title in 'report.sty').
%
%   Default settings can be made in here, such as
%        \def\@dept{Mathematics and Statistics}   
%   below. Can be overriden in .tex files by \dept{Other Dept}
%
%   Definitions particular to your thesis should be made in the
%   preamble of the main .tex document in the following way: 
%        \committeechair{David R.\ Hayes}

% Additional variables needed
\def\dept#1{\gdef\@dept{#1}}
\def\headofdepartment#1{\gdef\@headofdepartment{#1}}
\def\committeechair#1{\gdef\@committeechair{#1}}
\def\firstreader#1{\gdef\@firstreader{#1}}
\def\secondreader#1{\gdef\@secondreader{#1}}
\def\outsidereader#1{\gdef\@outsidereader{#1}}
\def\submitdate#1{\gdef\@submitdate{#1}}
\def\copyrightyear#1{\gdef\@copyrightyear{#1}} 

% Those are the things you should define in your thesis:
\def\@title{}
\def\@author{}
\def\@dept{Mathematics and Statistics}         % default
\def\@headofdepartment{}
\def\@committeechair{}
\def\@firstreader{}
\def\@secondreader{}
\def\@outsidereader{}

% If \submitdate or \copyrightdate are not defined in .tex files, LaTeX
% computes them from \today. For UMass, this should be either
% February 20??  or September 20?? or May 20??  (nothing else)
\def\@submitdate{\ifcase\the\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space \number\the\year}
\ifnum\month=12
    \@tempcnta=\year \advance\@tempcnta by 1
    \edef\@copyrightyear{\number\the\@tempcnta}
\else
    \def\@copyrightyear{\number\the\year}
\fi


% Define new conditional to check for copyright, tables, figures.
% Creates control sequences \...true  \...false ....
\newif\ifcopyright 
\newif\iffigurespage 
\newif\iftablespage

% Set defaults:
\copyrighttrue    % We always want a copright page. (see \copyrightpage)
\figurespagetrue  % You have to put \figurespagetrue in your document
\tablespagetrue   % before the command \afterpreface if you want a
                  % list of figures. Dito for tables.
%%%%


%%%%%   Preliminary pages : brief listing of implemented rules:
% First pages should 
%
% 1) not have page numbers, and should not be listed in the Table of Contents
%        [title,copyright,signature, dedication], or
%
% 2) have roman page numbers, and BE listed in the Table of Contents
%        [Acknowledgements & Abstract]
%
% After that, we use arabic numerals:
%
%%%%%%%
%%      Title page
%

\def\titlep{%
        \thispagestyle{empty}%
        \null\vskip1in%
        \begin{center}
                {\large\uppercase\expandafter{\@title}}
        \end{center}
        \vfill
        \begin{center}
                 A Dissertation Presented\\
                        \hfill \\
                            by\\
                        \hfill \\
                     \uppercase\expandafter{\@author}  % must be uppercase
        \end{center}
        \vfill
        \begin{center}
          Submitted to the Graduate School of the \\[-.4cm]
          University of Massachusetts Amherst in partial fulfillment \\[-.4cm] 
          of the requirements for the degree of\\
                \hfill \\
                DOCTOR OF PHILOSOPHY \\
                \hfill \\
                \@submitdate\\
                \hfill \\
                Department of \@dept \\
        \end{center}\vskip.5in\newpage}




%%%%%%%
%%      Copyright page (if you don't want to have one, put command
%                       \copyrightfalse in your .tex file before you
%                       call \beforepreface).
%

\def\copyrightpage{%
        \thispagestyle{empty}%
        \null\vfill
        \begin{center}
                \copyright\ Copyright by
                \rm{\@author} \@copyrightyear\\
                All Rights Reserved
        \end{center}
        \vfill\newpage}

%%%%%%%
%%      Signature page   (may give a list of warnings on compilation
%                         which are annoying but harmless)
%
\def\signaturepage{%
        \thispagestyle{empty}%
\begin{center}
                {\large\uppercase\expandafter{\@title}}
\end{center}
        \vfill
        \begin{center}
                 A Dissertation Presented\\
                        \hfill \\
                            by\\
                        \hfill \\
                     \uppercase\expandafter{\@author}
        \end{center}
        \vfill
        \begin{minipage}{4in}
        Approved as to style and content by: \\
        \hfill \\
        \hfill \\
        \shortstack[l]{\vrule width 4in height 0.4pt \\
                        \@committeechair, Chair} \\
        \hfill \\
        \hfill \\
        \shortstack[l]{\vrule width 4in height 0.4pt \\
                        \@firstreader, Member} \\
        \hfill \\
        \hfill \\
        \shortstack[l]{\vrule width 4in height 0.4pt \\
                        \@secondreader, Member} \\
        \hfill \\
        \hfill \\
        \shortstack[l]{\vrule width 4in height 0.4pt \\
                        \@outsidereader, Member} \\
        \end{minipage}
        \vfill
        \hfill \shortstack[l]{\vrule width 3in height 0.4pt\\
                        \@headofdepartment, Department Head\\
                        \@dept }
        \newpage}

\def\beforepreface{             % This makes the title, copyright and
        \pagenumbering{roman}   % signature pages.
        \thispagestyle{empty}
        \titlep
        \ifcopyright\copyrightpage\fi
        \brokenpenalty=100      % To prevent warnings about underfull
                                % \vbox's.
        \signaturepage
%        \addtocontents{toc}{\protect\hfill\underline{Page}
%                            \addvspace{\baselineskip}}  %% MLS 041896
}         

\def\dedicationsection#1{%       % Empty page, no page number, no
        \thispagestyle{empty}%   % entry in the table of contents
%        \chapter*{\protect\uppercase\expandafter{#1}} % Don't want
%        pageno
% Instead, we use commands defined for \chapter* above
  \vspace*{30pt}                       % Space at top of page. (as above)
  \begin{center}
    \Large 
    #1                          % Chapter heading may be ``Dedication''
                                % or empty; text afterwards.
  \end{center}\par
  \nobreak                             % TeX penalty to prevent page break.
  \vskip 30pt                          % Space between title and text.
                        }      

\def\prefacesection#1{%         %(replaced 'chapter' 
        \thispagestyle{plain}%  % by 'listintoc'and  
        \chapter*{\protect\uppercase\expandafter{#1}}
        \addtocontents{toc}{\protect\addvspace{\baselineskip}}
        \addcontentsline{toc}{listintoc}{{\protect\uppercase\expandafter{#1}}}}
                                                
%%%%%%%   
%%      ``After preface''
%       Makes a Table of Contents, and List(s) of
%       Tables (if command \tablespagetrue in .tex file),
%       and/or of Figures (if \figurespagetrue in .tex file)
%       Observe that we briefly switch to single spacing for the table
%       of contents.
%

\def\afterpreface{\newpage
        \begintablespace
        \tableofcontents 

        \newpage
% These lines make a List of Tables page after the Table of Contents
% page, iff you include the command '\tablespagetrue' in your '.tex'
% file.

        \iftablespage
                {%\addvspace{20pt}
%               \let\saveaddvspace=\addvspace
%               \def\addvspace##1{}
                \addtocontents{lot}{\protect Table \hfill Page
                                    \addvspace{\baselineskip}}  %% MLS 041896
                \listoftables
%               \let\addvspace=\saveaddvspace}
                }
                \newpage
        \fi
% These lines make a List of Figures page after the Table of Contents
% page, iff you include the command '\figurespagetrue' in your '.tex'
% file.

        \iffigurespage

                {%\addvspace{20pt}
%               \let\saveaddvspace=\addvspace
%               \def\addvspace##1{}
                \addtocontents{lof}{\protect Figure \hfill Page
                                    \addvspace{\baselineskip}}
                \listoffigures
%               \let\addvspace=\saveaddvspace}
                }
                \newpage
        \fi
% 'figure' ends here.

%% Finally, we want to use double spacing 

        \endtablespace
        \begindoublespace

%%%%%   Initialization of pagestyle 
% See above for a definition of these different Page Styles ;
% can be changed to \pagestyle{thesis} if you prefer page numbers 
% in the top right corner. You can also check out the preliminary 
% page styles : 'preliminary' or 'preliminarydraft' .

%       \pagestyle{thesis}              %   Page # on top 
%       \pagestyle{draft}               %   Page # on top + 'DRAFT'
%       \pagestyle{preliminary}         %   Page # at bottom
%       \pagestyle{draftpreliminary}    %   Page # at bottom + 'DRAFT'

% I think one could actually move these \pagestyle definitions 
% into the .tex file itself! [One can!]
% If one does not define any of these, the default appears to be 
% preliminary which I think is the best anyway.
% 
% Finally, switch pagenumbering to arabic and close definition of
% \afterpreface ; the first chapter may begin.
        \pagenumbering{arabic}} %  Here ends \afterpreface. 


%%%%%%
%%  Finally, set penalties for breaking lines, pages, backs ...
%

% Disallow page breaks at hyphens (this will give some underfull vbox's,
% so an alternative is to use \brokenpenalty=100 and manually search
% for and fix such page breaks)%
   
\brokenpenalty=20000
%

\makeatother    %   Make '@' special again to deny access to private
                %   macros of LaTeX and Plain TeX.  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%-------------------------------------------------------------------------
%%%%%          O B S O L E T E (since not NFSS), replaced by
%%%%%          \define@mathsizes{??}{??}{??} 
%%%%%-------------------------------------------------------------------------
%%%%%
% This section is needed if you plan to have any subscripts in your thesis,
% since the grad school has decided that the subscripts also have to be nine
% point.  The subsubscripts have been changed to seven point (which is
% undoubtedly too small), in the hope that they still can be  used.
% (subscript refers to either sub or superscript
%
%%%%%%   UNFORTUNATELY, IT DOESN'T WORK WITH THE New Font Selection
%%%%%%   Scheme -- we hope that things go through without this. If you
%%%%%%   look at the NFSS documtentation nfssinst.tex
%%%%%%   (/usr/local/lib/tex/inputs on June 12, 94)) you will find a
%%%%%%   comment that under NFSS \tenrm \tentt and the like are not
%%%%%%   defined. They advise to define \tenrm (etc.) ``by hand'' as
%%%%%%   follows: 
%\newcommand{\twlrm}{\fontfamily{cmr}%
%       \fontseries{m}\fontshape{n}\fontsize{8}{10pt}
%       \selectfont}
%
%%%       If we assumed 'oldlfont.sty', this could be shortened to
%%%       \newcommand{\tenrm}{\fontsize{10}{12pt}\tt}
%
%\newcommand{\twlmi}{\fontfamily{cmr}%
%       \fontseries{m}\fontshape{it}\fontsize{8}{10pt}
%       \selectfont}
%
%\newcommand{\twlsy}{\fontfamily{cmr}%
%       \fontseries{m}\fontshape{it}\fontsize{8}{10pt}
%       \selectfont}
%
%% \tenex is already defined in lfonts.sty, so cannot (need not)
%% redefine it here  

%------original from thales -----------------%
%\def\xiipt{
%\textfont\z@\twlrm
%  \scriptfont\z@\tenrm \scriptscriptfont\z@\egtrm
%\textfont\@ne\twlmi \scriptfont\@ne\tenmi \scriptscriptfont\@ne\egtmi

%\textfont\tw@\twlsy \scriptfont\tw@\tensy \scriptscriptfont\tw@\egtsy
%\textfont\thr@@\tenex \scriptfont\thr@@\tenex \scriptscriptfont\thr@@\tenex
%\textfont\xmfam=\twlxm \scriptfont\xmfam=\tenxm \scriptscriptfont\xmfam=\egtxm
%\textfont\ymfam=\twlym \scriptfont\ymfam=\tenym \scriptscriptfont\ymfam=\egtym
%\def\unboldmath{\everymath{}\everydisplay{}\@nomath\unboldmath
%          \textfont\@ne\twlmi 
%          \textfont\tw@\twlsy \textfont\lyfam\twlly
%          \@boldfalse}\@boldfalse
%\def\boldmath{\@ifundefined{twlmib}{\global\font\twlmib\@mbi\@magscale1\global
%        \font\twlsyb\@mbsy \@magscale1\global\font
%         \twllyb\@lasyb\@magscale1\relax\@addfontinfo\@xiipt
%              {\def\boldmath{\everymath
%                {\mit}\everydisplay{\mit}\@prtct\@nomathbold
%                \textfont\@ne\twlmib \textfont\tw@\twlsyb 
%                \textfont\lyfam\twllyb\@prtct\@boldtrue}}}{}\@xiipt\boldmath}%
%\def\prm{\fam\z@\twlrm}%
%\def\pit{\fam\itfam\twlit}\textfont\itfam\twlit \scriptfont\itfam\tenit
%   \scriptscriptfont\itfam\egtit
%\def\psl{\fam\slfam\twlsl}\textfont\slfam\twlsl 
%     \scriptfont\slfam\tensl \scriptscriptfont\slfam\tensl
%\def\pbf{\fam\bffam\twlbf}\textfont\bffam\twlbf 
%   \scriptfont\bffam\tenbf \scriptscriptfont\bffam\tenbf 
%\def\ptt{\fam\ttfam\twltt}\textfont\ttfam\twltt
%   \scriptfont\ttfam\tentt \scriptscriptfont\ttfam\tentt 
%\def\psf{\fam\sffam\twlsf}\textfont\sffam\twlsf
%    \scriptfont\sffam\tensf \scriptscriptfont\sffam\tensf
%\def\psc{\@getfont\psc\scfam\@xiipt{\@mcsc\@magscale1}}%
%\def\ly{\fam\lyfam\twlly}\textfont\lyfam\twlly 
%   \scriptfont\lyfam\tenly \scriptscriptfont\lyfam\egtly
% \@setstrut \rm}
%
%\def\@xiipt{}
%-----------------------------------------------------------------------------
