%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MSUTHESIS.CLS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% $Header: /home/smithg/projects/thesis/documents/thesis_document/RCS/msuthesis.cls,v 1.3 2001/07/18 22:38:52 smithg Exp $
%%
%% this is msuthesis.cls, by Zhengzhu Feng
%% with several changes   by G. Brannon Smith <brannonsmith@yahoo.com> 
%%
%% LaTeX2e style file to format thesis or dissertation
%% according to the style guide of Mississippi State University.
%% 
%% credit: 
%%  report.cls from the LaTeX2e package,
%%  ut-thesis.cls by Francois Pitt (fpitt@cs.utoronto.ca>,
%%  msu-thesis.cls by Puri Bangalore (puri@erc.msstate.edu) and Edward
%%    Luke(lush@erc.msstate.edu)
%%  Jingwei Lu (ljw@cs.msstate.edu) provided some helpful reference
%% 
%% this format has not been approved by anyone, use at your own
%% risk...
%%
%%-------------------------------------------------------------------------

%%-------------------------------------------------------------------------
%% Revision History
%%-------------------------------------------------------------------------
%%
%% $Log: msuthesis.cls,v $
%% Revision 1.3  2001/07/18 22:38:52  smithg
%% Made several changes in response to my Library Review corrections which
%% were almost exclusively on the matter of spacing (margins, fig/text,
%% section titles, etc.). Many of the changes are simply reformatting or
%% reindenting to improve readability (IMHO). These usually are accompanied
%% by very verbose commentary which I will not repeat here.
%% One thing I have tried to do is collect many of the spacing values
%% togther near the top of the template to facilitate future changes that
%% may be needed. Some of this was achieved by creating new 'variables'
%% with a custom 'createlength' command and then substituting those for
%% the values throughout the code - like a #define directive. I also
%% fixed a missing 'Page' header title in the list of figures which was
%% evident when I had two pages in my list. A similar error might still exist
%% for the list of tables. In addition, the 'msufigure' environment was
%% added near the bottom to help deal with the figure/text spacing problem -
%% so that the space above and below a figure could be equal. All it does is
%% add the command '\singlespacing' - otherwise it should be the same as the
%% standard 'figure' environment. This may actually be unnessary nitpicking
%% but it still might be good practice to use it in case of future need to
%% change document figures en masse; it can always be made the same as
%% 'figure' for no effect.
%%
%% Revision 1.2  2001/04/09 21:10:26  smithg
%% Made various changes in an attempt at better compliance with the grad
%% school guidelines, particular regarding citations.
%%
%% Revision 1.1  2001/04/09 21:08:32  smithg
%% Initial revision
%%
%%
%%-------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}[1995/12/01]

\ProvidesClass{msuthesis}
[2000/06/01 v0.0 Mississippi State University thesis document style package] 
\LoadClassWithOptions{report}

%% spacing requirments are all handeled by setspace.sty
%% commands: \doublespacing \singlespacing
\RequirePackage{setspace}[1998/06/30]

%% caption style in figures and tables are handeled by caption2.sty 
%% a description of caption2 and graphics related information can be
%% found at CTAN/info/epslatex.pdf, look for it at a CTAN near you.
%\RequirePackage{caption2}[1995/06/30]


\AtEndDocument{\label{page:msuthesislastpage}}
\AtBeginDocument
{
  \addtocontents{toc}{\protect\contentsline{note}{}{Page}}
  \addtocontents{toc}{\protect\vskip -1em}
  \addtocontents{lof}{\protect\contentsline{note}{FIGURE}{Page}}
  \addtocontents{lot}{\protect\contentsline{note}{TABLE}{Page}}
  \doublespacing

%  \captionstyle{hang}
}

\newif\if@leftsubtitle
\newif\if@showsecnum
\DeclareOption{leftsubtitle}{\@leftsubtitletrue}
\DeclareOption{centersubtitle}{\@leftsubtitlefalse}
\DeclareOption{showsecnum}{\@showsecnumtrue}
\DeclareOption{notshowsecnum}{\@showsecnumfalse}
\ExecuteOptions{centersubtitle,showsecnum}
\ProcessOptions

%%---------------------------------------------------------------------------- 
%% Hints:
%%    "em" = the width of the capital 'M' in the current font
%%    "ex" = the height of the letter 'x' in the current font
%%    - smithg
%%---------------------------------------------------------------------------- 

  
%%---------------------------------------------------------------------------- 
%% set various margin parameters
%% numbers copied from Edward Luke's Ph.D thesis
%%
%% smithg - According to Kopka & Daly:
%% "In order to calculate the page layout precisely, one must realize that
%%  LaTeX measures all distances from a point one inch from the top of the
%%  paper and one inch from the left edge. Thus the total left margin is
%%  \oddsidemargin plus one inch."
%%
%% VERTICAL
\setlength{\topmargin}     {0.00in}          % Add 1.0in...
\setlength{\headheight}    {0.15in}
\setlength{\headsep}       {0.20in}          % Distance from header to body
                                             % such as the page num to text
\setlength{\textheight}    {8.40in}
\setlength{\footskip}      {0.25in}

%% HORIZONTAL
\setlength{\oddsidemargin} {0.53in}          % Add 1.0in...
\setlength{\evensidemargin}{\oddsidemargin}  % no diff btw odd & even pages
\setlength{\textwidth}     {5.95in}

%% There is no right or bottom margin per se; they depend on the others. So:
%% Effective      paper  offset oddsidemargin       textw
%% Rightmargin  =  8.5 - (1.0 + 0.53              + 5.95) =  8.5 - 7.48 = 1.02
%%
%%                paper  offset top   hhgt   hsep + thgt
%% Bottommargin = 11.0 - (1.0 + 0.0 + 0.15 + 0.20 + 8.40) = 11.0 - 9.75 = 1.25
%%
%% Page num (i.e., foot) is \footskip CLOSER to bottom so   1.25 - 0.25 = 1.0
%%    - smithg
%%---------------------------------------------------------------------------- 


%%---------------------------------------------------------------------------- 
%% smithg - Figure/text spacing: these are builtin, not custom

% The vertical spacing between floats and text, for both top and bottom floats
\setlength{\textfloatsep}{5ex plus1pt minus1pt}

% The vertical spacing above and below a float that appears in the middle of a
% text page with the 'h' placement argument.
\setlength{\intextsep}{4ex plus1pt minus1pt}

%% DEBUG - set seps to 0 to see what other spacing is in effect around figs
%\setlength{\intextsep}{0ex plus1pt minus1ex}
%\setlength{\textfloatsep}{0ex plus1pt minus1ex}
%%---------------------------------------------------------------------------- 


%%---------------------------------------------------------------------------- 
%% smithg - an alternative approach to space formatting
%%          instead of searching through template for these various
%%          measurements, why not create custom "variables" with descriptive
%%          names and collect them up here?
\newcommand{\createlength}[2] % Two args: 1) name ; 2) value
{
  \newlength{#1}     % creates the new length variable/command
  \setlength{#1}{#2} % and sets it right here
}

\createlength{\abovetoctitle}{0.3in}
\createlength{\belowtoctitle}{0.4in}
\createlength{\aboveappendixtitle}{3.2in}
% There is no \belowappendixtitle - start a newpage
\createlength{\abovechaptertitle}{0.25in}
\createlength{\belowchaptertitle}{0.25in}
\createlength{\abovesectiontitle}{4ex plus1pt minus1pt} % preskip
\createlength{\belowsectiontitle}{1pt plus0pt minus0pt} % postskip
                                 % not sure why 1pt has a big effect

% Spacing between bottom of a (non-figure) fbox and following text.
% Library review said this should be DS. This is actually kind of tricky;
% This assumes that the text following the box IS in a new paragraph and 
% spaced accordingly. I often use \noindent to keep the text in line.
\newcommand{\belowfboxspace}{\\[3ex]}


%% There are additional vspace commands in the text that I didn't bother
%% moving up here (Title page, copyright page, etc.) because I didn't need
%% to alter them. If one needs to change them, consider moving them up here
%%    - smithg
%%
%%---------------------------------------------------------------------------- 


%%----------------------------------------------------------------------------
%% commands that set name of degree, author, etc. 
%% this is learned from ut-thesis.cls
\renewcommand{\author}[1]   {\ifx\empty#1\empty\else\gdef\@author{#1}\fi}
\renewcommand{\title}[1]    {\ifx\empty#1\empty\else\gdef\@title{#1}\fi}

\newcommand{\doctype}[1]    {\ifx\empty#1\empty\else\gdef\@doctype{#1}\fi}
\newcommand{\degree}[1]     {\ifx\empty#1\empty\else\gdef\@degree{#1}\fi}
\newcommand{\department}[1] {\ifx\empty#1\empty\else\gdef\@department{#1}\fi}
\newcommand{\degreeyear}[1] {\ifx\empty#1\empty\else\gdef\@degreeyear{#1}\fi}
\newcommand{\degreemonth}[1]{\ifx\empty#1\empty\else\gdef\@degreemonth{#1}\fi}
\newcommand{\degreeday}[1]  {\ifx\empty#1\empty\else\gdef\@degreeday{#1}\fi}
\newcommand{\major}[1]      {\ifx\empty#1\empty\else\gdef\@major{#1}\fi}
\newcommand{\majorprofessor}[1]
  {\ifx\empty#1\empty\else\gdef\@majorprofessor{#1}\fi}

%% this is learned from report.cls
\newcommand{\themonth}
{
  \ifcase\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
}

%% set default values
%% you should set all these values before \begin{document}
\doctype{Thesis}
\degree{\mbox{}}
\major{\mbox{}}
\majorprofessor{\mbox{}}
\department{\mbox{}}
\author{\mbox{}}
\title{\mbox{}}
\degreeyear{\number\year}
\degreemonth{\getmonth}
\degreeday{\number\day}


%% paragraph indent
\parindent 5ex

\newcommand{\chapternum}{\@Roman\c@chapter}

% change so that the first paragraph is also indented
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{plain}%
                    \global\@topnum\z@
                    \@afterindenttrue
                    \secdef\@chapter\@schapter}

\newcommand\titleappendixa{}
\newcounter{pageappendixa}
\def\@chapter[#1]#2{
  \ifnum \c@chapter=\z@
          \renewcommand{\thepage}{\arabic{page}}
          \if@inappendix 
          \else 
             \addtocontents{toc}{\vskip 1em \noindent CHAPTER\par}
             \setcounter{page}{1} 
          \fi
          \renewcommand{\rightmark}{}
          \pagestyle{headings}
  \fi

  \if@inappendix
     \ifnum\c@chapter=1
          \addtocontents{toc}{\vskip 1em \noindent APPENDIX\par}
          \addtocontents{toc}{\protect\contentsline{chapter}{\protect\numberline { \protect\parbox[b]{4em}%  
                {\hfill {A}.} }{\titleappendixa}}{\thepageappendixa}}
     \fi  
  \fi

  \ifnum \c@secnumdepth >\m@ne
  \refstepcounter{chapter}%
  \typeout{\@chapapp\space\thechapter.}%
  \if@inappendix
     \ifnum \c@chapter=1
       \renewcommand\titleappendixa{\uppercase{#1}}
       \setcounter{pageappendixa}{\c@page}
     \else
       \addcontentsline{toc}{chapter}%
       {\protect\numberline
         { \protect\parbox[b]{4em}{\hfill
             {\chapternum}.} }{\uppercase{#1}}  }%
     \fi
  \else
     \addcontentsline{toc}{chapter}%
     {\protect\numberline
       { \protect\parbox[b]{4em}{\hfill
           {\chapternum}.} }{\uppercase{#1}}  }%
  \fi%   
  \else
  \addcontentsline{toc}{chapter}{\uppercase{#1}}%
  \fi
  \chaptermark{#1}%
%  \addtocontents{lof}{\protect\addvspace{10\p@}}%
%  \addtocontents{lot}{\protect\addvspace{10\p@}}%
  \if@twocolumn
  \@topnewpage[\@makechapterhead{#2}]%
  \else
  \@makechapterhead{#2}%
  \@afterheading
  \fi}

\def\@makechapterhead#1{%
  % Space above the chapter title (in addition to margins)
  \if@inappendix%
    \vspace*{\aboveappendixtitle}%    %orig \vspace*{3.2in}%
  \else% 
    \vspace*{\abovechaptertitle}%     %orig \vspace*{0.28in}%
  \fi% 
  { \centering \normalfont \doublespacing
    \ifnum \c@secnumdepth >\m@ne
     \large \MakeUppercase\@chapapp\space \space%
     \if@inappendix%
         \ifnum \c@chapter>1 
             \chapternum\\
         \else 
             \ref{numappendixa}\\
         \fi
     \else
         \chapternum\\
     \fi
    \fi
    \interlinepenalty\@M
    \uppercase{#1} \par\vskip \belowchaptertitle % was 0.25in
    }
  \if@inappendix
     \clearpage % Appendix title get their own page
  \fi
}

\def\@makeschapterhead#1{%
  \vspace*{\abovetoctitle}%  % orig \vspace*{0.3in}%
  {\parindent \z@ \centering \normalfont  \interlinepenalty\@M
    \normalfont\normalsize \MakeUppercase #1\par\nobreak
    \vskip \belowtoctitle % orig \vskip 0.4in
  }
}


%\renewcommand{\thesection}{}
%\renewcommand{\thesubsection}{}
%\renewcommand{\thesubsubsection}{}


%
% remove the section number
%

\def\@startsection#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
    {\@ssect{#3}{#4}{#5}{#6}}%
    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}

\def\@ssect#1#2#3#4#5{%
  \@tempskipa #3\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #4{%
        \@hangfrom{\hskip #1}%
          \interlinepenalty \@M #5\@@par}%
    \endgroup
  \else
    \def\@svsechd{#4{\hskip #1\relax #5}}%
  \fi
  \@xsect{#3}}

\def\@sect#1#2#3#4#5#6[#7]#8{%
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \if@showsecnum%<------- zhengzhu feng
    \protected@edef\@svsec{\@seccntformat{#1}\relax}%
    \else%
    \let\@svsec\@empty%
    \fi%
  \fi
  \@tempskipa #5\relax
  \ifdim \@tempskipa>\z@
  \typeout{typeout: 1.#1 2.#2 3.#3 4.#4 5.#5 }
    \begingroup
      #6{%
        \@hangfrom{\hskip #3\relax\@svsec}%
          \interlinepenalty \@M #8\@@par}%
    \endgroup
    \csname #1mark\endcsname{#7}%
    \addcontentsline{toc}{#1}{%
      \ifnum #2>\c@secnumdepth \else
      \if@showsecnum%<---- zhengzhu feng
      \protect\numberline{\csname the#1\endcsname}%
      \fi
      \fi
      #7}%
  \else
    \def\@svsechd{%
      #6{\hskip #3\relax
      \@svsec #8}%
      \csname #1mark\endcsname{#7}%
      \addcontentsline{toc}{#1}{%
        \ifnum #2>\c@secnumdepth \else
        \if@showsecnum%<---- zhengzhu feng
        \protect\numberline{\csname the#1\endcsname}%
        \fi
        \fi
        #7}}%
  \fi
  \@xsect{#5}} 


%%----------------------------------------------------------------------------
% modification to \section commands learned from Edward Luke's
%    msu-thesis.cls 

% smithg - according to Kopka & Daly, internal section syntax is:
%
% \@startsection {sec-name}{level}{indent}{preskip}{postskip}
% {style}*[short title]{title}            ------rubber------
%        ---optional---                   ie can shrink/grow

% smithg - I think there is some misunderstanding here.
%          the original comments seem to imply a 12pt font size BUT the
%          "12pt" in the code affects spacing since it is in the "preskip"
%          parameter - not font size. Font size changes go in the "style"
%          parameter.
%
% section title 12 point, 
% 2 blank lines before, 1 after
% smithg - my library review demanded triple spacing (TS)
\renewcommand{\section}
{
  \ifnum \c@section=0%
     \addtocontents{toc}{\vskip 1em \par}%
  \fi%

  \@startsection {section}{1}{\z@}
  \abovesectiontitle % preskip - was %{12pt plus 1pt minus 1pt}
  \belowsectiontitle % postskip
  {\if@leftsubtitle \noindent \else \centering \fi \bf} % style
} 

% make subsection titles centered and 12 point, 
% 1 blank line before, 1 after
\renewcommand\subsection
{
  \@startsection {subsection}{2}{\z@}
  {12pt plus 2pt minus 2pt} % preskip
  { 1pt plus 0pt minus 0pt} % preskip
  {\if@leftsubtitle \noindent \else \centering \fi} % style
}

% make subsubsection centered and 11 point
\renewcommand\subsubsection
{
  \@startsection {subsubsection}{2}{\z@}
  {11pt plus 2pt minus 2pt} % preskip
  { 1pt plus 0pt minus 0pt} % postskip
  {\if@leftsubtitle \noindent \else \centering \fi} % style
}

% make subsubsection centered and 10 point
\newcommand\subsubsubsection
{
  \@startsection {subsubsubsection}{2}{\z@}
  {10pt plus 2pt minus 2pt} % preskip
  { 1pt plus 0pt minus 0pt} % postskip
  {\if@leftsubtitle \noindent \else\centering \fi} % style
}

%%----------------------------------------------------------------------------


% modified from Edward Luke's thesis
\newcounter{toccount}
\setcounter{toccount}{1}
\newcounter{tocappendix}
\setcounter{tocappendix}{0}
\newcommand{\tocheader}{}

\def\ps@tocheadings{%
  \renewcommand{\@oddfoot}{\hfil\thepage\hfil}
  \renewcommand{\@evenfoot}{\@oddfoot}
  \renewcommand{\@evenhead}{\tocheader}
  \renewcommand{\@oddhead}{\@evenhead}
  \let\@mkboth\@gobbletwo
  \let\chaptermark\@gobble
  \let\sectionmark\@gobble
  }

%% modify definition of \tableofcontents, \listoffigures, and
%  \listoftables

\renewcommand\tableofcontents{%
  \clearpage
  \renewcommand{\tocheader}{\ifnum\c@toccount>0{\ifnum\c@tocappendix=2{APPENDIX}\else{CHAPTER}\fi\hfil{Page}\ifnum\c@tocappendix=1\setcounter{tocappendix}{2}\fi}\else\setcounter{toccount}{1}\ifnum\c@tocappendix=1\setcounter{tocappendix}{2}\fi\fi}  
  \pagestyle{tocheadings}
  \begingroup
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
%   %library says no need to list table of contents in table of contents
%   \addcontentsline{toc}{chapter}{\MakeUppercase\contentsname}
   \vskip -2em
       \singlespacing
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    \endgroup
    }

% make some change to the apperance of the table of contents, this is
% learned from Edward Luke's class file
\renewcommand*\l@chapter[2]{%
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}%
    \vskip 1.0em \@plus\p@
    \setlength\@tempdima{5em}%
    \begingroup
    \parindent \z@ \rightskip \@pnumwidth
    \parindent -2em
%    \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode %\bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak\hfil \leaders\hbox{$\m@th
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
        mu$}\hfill
      \nobreak\hb@xt@\@pnumwidth{\hss#2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}

\newcommand*\l@note[2]{%
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}%
    \vskip 1.0em \@plus\p@
    \setlength\@tempdima{4.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode %\bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}

\newcommand*\l@appendix[2]{%
  \setcounter{tocappendix}{1}
}

\renewcommand*\l@section{\@dottedtocline{1}{3.0em}{2em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{5em}{2.8em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{7.80em}{3.8em}}

%%
%%
%%
\renewcommand\l@figure{\vskip 0.8em \@dottedtocline{1}{1.5em}{2.3em}}

\renewcommand\listoffigures
{%
  \clearpage
  \renewcommand{\tocheader}{{FIGURE}\hfil{Page}} % smithg
  \pagestyle{tocheadings}
  \begingroup%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename
        \@mkboth{%
           \MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}}
  \addcontentsline{toc}{chapter}{\protect\hspace{2em}\MakeUppercase\listfigurename}
   \vskip -2.8em
   \singlespacing
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    \endgroup
    }
\renewcommand\l@table\l@figure
\renewcommand\listoftables{%
    \clearpage
\renewcommand{\tocheader}{TABLE}
  \pagestyle{tocheadings}
  \begingroup%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename
        \@mkboth{%
           \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
  \addcontentsline{toc}{chapter}{\protect\hspace{2em}\MakeUppercase\listtablename}
   \vskip -2.8em
   \singlespacing
    \@starttoc{lot}%
    \if@restonecol\twocolumn\fi
    \endgroup
}


\newif\if@inappendix
\@inappendixfalse
\renewenvironment{appendix}{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \@inappendixtrue      
  \gdef\@chapapp{\appendixname}%
  \gdef\chapternum{\@Alph\c@chapter}
  \renewcommand{\thechapter}{\@Alph\c@chapter}}
{
  \ifnum \c@chapter>1
  \setcounter{chapter}{0}
  \refstepcounter{chapter}
  \label{numappendixa}
  \else
  \setcounter{chapter}{-1}
  \refstepcounter{chapter}
  \label{numappendixa}
  \addtocontents{toc}{\protect\contentsline{chapter}{\protect\hspace
      {2em}\protect\MakeUppercase{Appendix}}{\thepageappendixa}}
  \fi
}

\renewcommand{\thepage}{\roman{page}}



%%----------------------------------------------------------------------------
%% title page
\renewcommand{\maketitle}
{
  \begingroup
  \newpage
  %use roman numbering for preliminary pages
  \renewcommand{\thepage}{\roman{page}}                       
  \thispagestyle{empty} %no page number for title page
  \vspace*{1.5in}
  \begin{center}
    {\MakeUppercase\@title} \\
    \vspace{0.8in}
    By\\
    {\@author}
  \end{center}
  \begin{center}
    \vspace{1.0in}
    \singlespacing
    {\@doctype}\\
    Submitted to the Faculty of\\
    Mississippi State University\\
    in Partial Fulfillment of the Requirements\\
    for the Degree of {\@degree}\\
    in {\@major}\\
    in the Department of {\@department}\\
    \vspace{2em}
    Mississippi State, Mississippi\\
    \vspace{1em}
    {\@degreemonth}\ {\@degreeyear}
  \end{center}
  \endgroup
}
%%----------------------------------------------------------------------------


%%----------------------------------------------------------------------------
%% signature page
%% this seems to be the easiest way, at least to me...
%% you can define up to ten signatures, but probably
%% only 8 will fit in.
\newcommand{\signaturea}[1]%
  {\ifx\empty#1\empty\else\gdef\@signaturea{#1}\fi}
\newcommand{\signatureb}[1]%
  {\ifx\empty#1\empty\else\gdef\@signatureb{#1}\fi}
\newcommand{\signaturec}[1]%
  {\ifx\empty#1\empty\else\gdef\@signaturec{#1}\fi}
\newcommand{\signatured}[1]%
  {\ifx\empty#1\empty\else\gdef\@signatured{#1}\fi}
\newcommand{\signaturee}[1]%
  {\ifx\empty#1\empty\else\gdef\@signaturee{#1}\fi}
\newcommand{\signaturef}[1]%
  {\ifx\empty#1\empty\else\gdef\@signaturef{#1}\fi}
\newcommand{\signatureg}[1]%
  {\ifx\empty#1\empty\else\gdef\@signatureg{#1}\fi}
\newcommand{\signatureh}[1]%
  {\ifx\empty#1\empty\else\gdef\@signatureh{#1}\fi}
\newcommand{\signaturei}[1]%
  {\ifx\empty#1\empty\else\gdef\@signaturei{#1}\fi}
\newcommand{\signaturej}[1]%
  {\ifx\empty#1\empty\else\gdef\@signaturej{#1}\fi}

\newcommand{\totalsignatures}[1]%
  {\ifx\empty#1\empty\else\gdef\@totalsignatures{#1}\fi}
\newcommand{\signatureheight}[1]%
  {\ifx\empty#1\empty\else\gdef\@signatureheight{#1}\fi}
\newcommand{\signaturewidth}[1]%
  {\ifx\empty#1\empty\else\gdef\@signaturewidth{#1}\fi}
\newcommand{\sigtitletoauthor}[1]%
  {\ifx\empty#1\empty\else\gdef\@sigtitletoauthor{#1}\fi}
\newcommand{\sigauthortoapproved}[1]%
  {\ifx\empty#1\empty\else\gdef\@sigauthortoapproved{#1}\fi}


\totalsignatures{6}
%% space for actual signature
\signatureheight{0.3in}
\signaturewidth{2.8in}
\sigtitletoauthor{0.8in}
\sigauthortoapproved{0.3in}


\signaturea{Major Professor}
\signatureb{Committee Member}
\signaturec{Committee Member}
\signatured{Graduate Coordinator}
\signaturee{Dean of the College}
\signaturef{use command $\backslash$signaturef to define this signature}
\signatureg{use command $\backslash$signatureg to define this signature}
\signatureh{use command $\backslash$signatureh to define this signature}
\signaturei{use command $\backslash$signaturei to define this signature}
\signaturej{use command $\backslash$signaturej to define this signature}

\newcommand{\approval}{
\newpage
\thispagestyle{empty} 
%don't count this page
\addtocounter{page}{-1}
\vspace*{0.3in}
\begin{center}
{\MakeUppercase\@title}\\[\@sigtitletoauthor]
By\\
{\@author}\\[\@sigauthortoapproved]
\end{center}
Approved: \\[{\@signatureheight}]
\ifnum \@totalsignatures > 0
\noindent
\parbox[t]{\@signaturewidth}{
        \singlespacing
        \rule{\@signaturewidth}{0.01in} \\
        {\@signaturea}}
\fi
\ifnum \@totalsignatures > 1
\hfill
\parbox[t]{\@signaturewidth}{
        \singlespacing
        \rule{\@signaturewidth}{0.01in} \\
        {\@signatureb}}\mbox{}%
\fi%
\ifnum \@totalsignatures > 2%
\\[{\@signatureheight}]
\noindent
\parbox[t]{\@signaturewidth}{
        \singlespacing            
        \rule{\@signaturewidth}{0.01in} \\
        {\@signaturec}}
\fi
\ifnum \@totalsignatures > 3
\hfill
\parbox[t]{\@signaturewidth}{
        \singlespacing    
        \rule{\@signaturewidth}{0.01in} \\
        {\@signatured}}%
\fi%
\ifnum \@totalsignatures > 4%
\\[{\@signatureheight}]
\noindent
\parbox[t]{\@signaturewidth}{
        \singlespacing
        \rule{\@signaturewidth}{0.01in} \\
        {\@signaturee}}
\fi%
\ifnum \@totalsignatures > 5
\hfill
\parbox[t]{\@signaturewidth}{
        \singlespacing
        \rule{\@signaturewidth}{0.01in} \\
        {\@signaturef}}%
\fi%
\ifnum \@totalsignatures > 6%
\\[{\@signatureheight}]
\noindent
\parbox[t]{\@signaturewidth}{
        \singlespacing
        \rule{\@signaturewidth}{0.01in} \\
        {\@signatureg}}
\fi%
\ifnum \@totalsignatures > 7
\hfill
\parbox[t]{\@signaturewidth}{
        \singlespacing
        \rule{\@signaturewidth}{0.01in} \\
        {\@signatureh}}%
\fi%
\ifnum \@totalsignatures > 8%
\\[{\@signatureheight}]
\noindent
\parbox[t]{\@signaturewidth}{
        \singlespacing
        \rule{\@signaturewidth}{0.01in} \\
        {\@signaturei}}
\fi%
\ifnum \@totalsignatures > 9
\hfill
\parbox[t]{\@signaturewidth}{
        \singlespacing
        \rule{\@signaturewidth}{0.01in} \\
        {\@signaturej}}\\
\fi
}
%%----- End signatures -------------------------------------------------------



%%----------------------------------------------------------------------------
%% abstract page
\renewenvironment{abstract}
{
  \begingroup
  \newpage
  \thispagestyle{empty} 
  %don't count this page
  \addtocounter{page}{-1}
  \begin{singlespace}
  \noindent
    \parbox{\textwidth}{Name: {\@author} \\}\\
    \parbox{\textwidth}{Date of Degree: {\@degreemonth}\space{\@degreeday}, {\@degreeyear} \\}\\
    \parbox{\textwidth}{Institution: Mississippi State University \\}\\
    \parbox{\textwidth}{Major Field: {\@major}\\}\\
    \noindent \parbox{\textwidth}{Major Professor: {\@majorprofessor}\\}\\
  Title of Study: \parbox[t]{4.7in}{\MakeUppercase\@title\\}\\
  Pages in Study:~\pageref{page:msuthesislastpage}
  \end{singlespace}
  \par\noindent Candidate for Degree of {\@degree} \vspace{-0.1in}\\ 
  \par
}{
\endgroup
}
%%----------------------------------------------------------------------------


%%----------------------------------------------------------------------------
%% copyright page
\renewcommand{\copyright}
{
  \newpage
  \vspace*{3.2in}
  \begin{center}
    \thispagestyle{empty}
    \addtocounter{page}{-1}  %don't count this page
    Copyright by \\
    {\@author} \\
    {\@degreeyear}
  \end{center}
}
%%----------------------------------------------------------------------------


%%----------------------------------------------------------------------------
%% Dedication page
\newenvironment{dedication}{
  \begingroup
  \chapter*{DEDICATION
    \@mkboth{DEDICATION}{DEDICATION}}
  \addcontentsline{toc}{chapter}{\protect\hspace{2em}DEDICATION}
  \mbox{}\par\vspace{-3em} 
}{
\endgroup
}
%%----------------------------------------------------------------------------


%%----------------------------------------------------------------------------
%% Acknowledgements page
\newenvironment{acknowledgment}
{
  \begingroup
  \chapter*{ACKNOWLEDGMENTS
    \@mkboth{ACKNOWLEDGMENTS}{ACKNOWLEDGMENTS}}
  \addcontentsline{toc}{chapter}{\protect\hspace{2em}ACKNOWLEDGMENTS}
  \mbox{}\par\vspace{-3em} 
}{
\endgroup
}
%%----------------------------------------------------------------------------


%%----------------------------------------------------------------------------
\renewcommand\contentsname{Table of Contents}
\renewcommand\listfigurename{List of Figures}
\renewcommand\listtablename{List of Tables}
\renewcommand\bibname{References}
%%----------------------------------------------------------------------------


%%----------------------------------------------------------------------------
% Additional custom structures
\newenvironment{msuenumerate}
{
  \vspace{-0.5em}
  \begin{enumerate}\singlespacing}{\end{enumerate}
  \vspace{-0.8em}
}

\newenvironment{msuitemize}
{
  \vspace{-0.5em}
  \begin{itemize}\singlespacing}{\end{itemize}
  \vspace{-0.8em}
}

%% smithg
% Using this instead of figure means the space before and after
% a figure will be equal - don't know why it works though.
\newenvironment{msufigure}[1][tbp]
{\begin{figure}[#1]\singlespacing}
{\end{figure}
} % Correct for new paragraph

\newcommand{\hang}{\\\rule{1.5em}{0em}}


% theorem and such can not be bold face, and the body of the
% theorem can not be italic.
\def\@begintheorem#1#2{\parskip -1em \trivlist
   \item[\hskip \labelsep{#1\ #2}]
\def\@endtheorem{\endtrivlist \vskip -0.8em}}

% for compatibility with msucaption.sty
%\newlength{\captionlength}
%\newlength{\captionskip}
%%----------------------------------------------------------------------------

\setdisplayskipstretch{1.6}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  End of MSUTHESIS.CLS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
