%% cs-nmsu-thesis.sty
%%
%% Latex file style for producing an NMSU PhD thesis formatted in
%% accordance with the graduate school guidelines:
%%    http://www.nmsu.edu/~gradcolg/Guidelines/index.html
%%
%% Excerpts from the guidelines are shown at the end.
%% This includes the 'Common Errors' section which should be reviewed,
%% since some of the guidelines are only mentioned there (e.g., same
%% size font for footnotes as in text).
%%
%% In addition, other requirements mentioned by te graduate editor as included
%% as well since not apparent from the explicit guidelines.
%%
%% This was based on the latex source for the following thesis's:
%%    Hai-Feng Guo (2000), High Performance Logic Programming
%%    Ahmed Malki (2001), Arabic Interactive Cross-Language Information Retrieval Via Natural Language Processing
%% Both of which were based on Enrico Pontelli's thesis source.
%% In addition, the latex templates prepared by the math department was used:
%%    http://piscopia.nmsu.edu/dept/ThesisFiles/ThesisFiles.html
%%
%% Usage (see wiley-thesis.tex for a sample):
%% \documentclass[12pt]{report}
%% \usepackage{cs-nmsu-thesis}
%% ...
%% \begin{document}
%% ...
%%
%%------------------------------------------------------------------------
%% NOTES:
%% - The report class is used for using chapters in addition to sections
%% - 12pt should be specified in the documentclass statement:
%%      http://www.nmsu.edu/~gradcolg/Guidelines/manuscript.html#FontSize
%%   This will ensure 6 lines/inch, as required elsewhere in the guidelines:
%%      http://www.nmsu.edu/~gradcolg/Guidelines/manuscript.html#LineSpacing
%%   1 inch = 72.27pt; so 12pt gives 6.0225 lines vs. 7.227 for default 10 pt
%% - *** Due to extra space added to account for accent marks, six
%%   lines at 12 point will actually take up more than 1 inch. For example,
%%   the default Times font in latex at 12 points uses 1.2 inch for six lines.
%% - See end of the file for a reference of some of the latex commands
%%   used here.
%%------------------------------------------------------------------------
%% References:
%%
%% Knuth, Donald E. (1991), The TeX book, Reading, MA: Addison-Wesley.
%%
%% Lamport, Leslie (1994), LaTeX: A Document Preparation System},
%% Reading, MA: Addison-Wesley.
%%
%% Goossens, Michel, Frank Mittelbach and Alexander Samarin (1994),
%% The LaTeX Companion, Reading, MA: Addison-Wesley.
%%

%% 
%%------------------------------------------------------------------------
%% TODO:
%% - List all the macros defined.
%% - Try to eliminate use of absolute vertical space skips to implement
%%   single spacing (eg, use fontsize variable rather than 'pc' or 'in').
%% - Remove extraneous latex definitions.
%% - Make sure no hardcoded values remain (e.g., 2000 for copyright year).
%% - Make sure widow/orphan control is enabled (see Common Errors
%%   below): An orphan is the first line of a paragraph on the last line
%%   of a page. The last line of the paragraph on a new page is a widow
%%   [xpt.sourceforge.net/techdocs/Latex/OrphanSpaceControl/Latex11.001.html].
%% - Figure out how to set inter-footnote spacing.
%%

%% TeX tracing support
%%
%% NOTES:
%% - Uncomment the following for detailed tracing for help in
%%  diagnosing macro expansion.
%% - See http://www.tug.org/utilities/plain/cseq.html for details
%% \tracingcommands=1  	%% trace commands
%% \tracingmacros=1	%% show when expanding macros and arguments
%% \tracingonline=1  	%% show diagnostic output
%% \tracingoutput=1  	%% show contents of shipped out boxes
%% 
%% Other tracing options
%% \tracinglostchars=1 	%% show characters not in current font
%% \tracingpages=1	%% show page-cost calculations
%% \tracingparagraphs=1	%% show summary of the line-breaking calculations
%% \tracingrestores=1	%% show save-stack details
%% \tracingstats=1	%% show memory usage statistics

%%........................................................................
%% Support for line spacing
%%

%% Take 1:
%%
\newlength{\@singlespace}
\setlength{\@singlespace}{\baselineskip}
\newlength{\@doublespace}
\setlength{\@doublespace}{2.0\baselineskip}
%%
\def\makesinglespaced{\setlength{\baselineskip}{\@singlespace}}
\def\makedoublespaced{\setlength{\baselineskip}{\@doublespace}}
%%
%% TODO (Take 2):
%% \newcommand\makesinglespaced{\renewcommand\baselinestretch{1}}
%% \newcommand\makedoublespaced{\renewcommand\baselinestretch{2}}

%%........................................................................
%% Change margins: 1.5" left; 1.25" right; 1.25" top; 1.25" bottom
%% note: leaves 5.75" width and 8.5" height
%%

% original margin settings:
%\oddsidemargin 0.5in \evensidemargin 0.5in
%\marginparwidth 40pt \marginparsep 10pt
%\topmargin 0pt \headsep .5in
%\textheight 8.1in \textwidth 6in
%\brokenpenalty=10000
%\renewcommand{\baselinestretch}{1.3}

%% Page style parameters
%% note: these should only be changed in the preamble
%% See Figure C.3 on p. 182 of Latex 2e text (Lamport 1995) for
%% descriptions. Also, see LaTeX 2.09 Quick Reference:
%%  http://brain.mhri.edu.au/text/latex209-qref.html
%%
%% The next settings give the correct margins for an NMSU Ph.D. thesis.
%%     1.50" left margin
%%     1.25" top and right 
%%     1.00" from bottom for the page number
%%     0.25" space between the page number and the last line.
\typeout{Redefining page style parameters:}
\typeout{Old evensidemargin (\the\evensidemargin), oddsidemargin (\the\oddsidemargin), textwidth (\the\textwidth), topmargin (\the\topmargin), textheight (\the\textheight)}
\def\mysetlength#1#2{
    %% Display the values of the new and out setting in inches
    %% note: \dimen255 is a temporary dimension register defined in plain tex
    \dimen255=0.013837#1	%% convert from points to inches (1/72.27)
    \typeout{Setting #1to #2 (from \the\dimen255 (in))}
    %% Perform the length parameter change
    \setlength{#1}{#2}
}
\mysetlength{\evensidemargin}{0.5in}
\mysetlength{\oddsidemargin}{0.5in}
\mysetlength{\textwidth}{5.75in}		%% 8.5 - 1.5 - 1.25 = 5.75
\mysetlength{\topmargin}{-0.25in}
%% \mysetlength{\textheight}{8.25in}		%% 11 - 1.25 - 1.0 - 0.25 = 8.5
\mysetlength{\textheight}{8.25in}
\typeout{New evensidemargin (\the\evensidemargin), oddsidemargin (\the\oddsidemargin), textwidth (\the\textwidth), topmargin (\the\topmargin), textheight (\the\textheight)}

%%........................................................................
%% Make footnotes larger and increase inter-footnote spacing
%%
\let\footnotesize = \small
%%
\let\oldfootnote = \footnote
\renewcommand\footnote[1]{\oldfootnote{#1\vspace{1pc}}}

%%........................................................................
%% Floats are after text, thus change settings:
%% TODO: determine whether this needs to be changed
\typeout{Redefining float placement parameters:}
\typeout{Old topfraction (\topfraction), bottomfraction (\bottomfraction), and
  textfraction (\textfraction)}
\renewcommand{\topfraction}{.8}
\renewcommand{\bottomfraction}{.9}
\renewcommand{\textfraction}{.1}
\typeout{New topfraction (\topfraction), bottomfraction (\bottomfraction), and
  textfraction (\textfraction)}

%%........................................................................
%% Definitions for title page, etc.

% suthesis defs:
%% TODO: find out whether this was based on Stanford University style file

\def\cl@chapter{\@elt{section}\@elt{footnote}}
%\def\thefigure{\@arabic\c@figure}
%\def\thetable{\@arabic\c@table}
\def\theequation{\arabic{equation}}

%% Definitions to be supplied by user.
%%
%% NOTES:
%% - Either \title or \thesistitle can be used. The latter avoids
%%   conflicts with other style files (eg, aclsu.sty uppercases \@title).
%% - \if expands macros unlike \ifx. The latter is used however in
%%   testing for underfined macros (eg, '\ifx\@fubar\undefined...').
%% - gdef makes a global definition (ie, not scoped by braces). It
%%   should only be needed if definitions defined within macros.
%%
%% TODO:
%% - Remove unused definitions (e.g., \principaladvisor).
%%
\def\thesistitle#1{\title{#1}\gdef\@thesistitle{#1}}
\def\dept#1{\gdef\@dept{#1}}
\def\chair#1{\gdef\@chair{#1}}
\def\firstcochair#1{\gdef\@firstcochair{#1}}
\def\secondcochair#1{\gdef\@secondcochair{#1}}
\def\dean#1{\gdef\@dean{#1}}
\def\@dean{}
\def\@chair{}
%% \def\@firstcochair{}
%% \def\@secondcochair{}
\def\firstadviser#1{\gdef\@firstadviser{#1}}
\def\secondadviser#1{\gdef\@secondadviser{#1}}
\def\thirdadviser#1{\gdef\@thirdadviser{#1}}
\def\fourthadviser#1{\gdef\@fourthadviser{#1}}
\def\fifthadviser#1{\gdef\@fifthadviser{#1}}
\def\submitdate#1{\gdef\@submitdate{#1}}
\def\copyrightyear#1{\gdef\@copyrightyear{#1}} % \author, \title in report
\def\@title{}
\def\@author{}
%%
\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
\newif\iffigurespage \newif\iftablespage
\figurespagetrue \tablespagetrue

%% Support for Master's vs. Doctorates
%%
%% NOTES:
%% - degree should only be specified for Master's
%%
%% TODO:
%% - define \ifundefined macro to simply checks
%%
\def\degree#1{\gdef\@degree{#1}}
\def\mastersdegree{\gdef\@degree{Master of Science}\gdef\@ismasters{1}}
\def\phddegree{\gdef\@degree{Doctor of Philosophy}\gdef\@isphd{1}}
\def\@getthesistype{\ifx\@isphd\undefined{thesis}\else{dissertation}\fi}

%% @getdept{}: Determines department if specified or otherwise uses Computer Science.
%%
%% NOTE: it is defined on one line to avoid extra spacing in the expansion
\def\@getdept{\ifx\@dept\undefined{Computer Science}\else{\@dept}\fi}

%% @gettitle{}: returns \@thesistitle or \@title as a fallback
%%
%% NOTE: See \nmsutitlepage for a workaround via local definitions
%% TODO: fix problem with \uppercase (even with \expandafter)
\def\@gettitle{\ifx\@thesistitle\undefined\@title\else\@thesistitle\fi}
%%
\def\@updatetitle{
\typeout{Updating title}
\typeout{Old: \@title}
\ifx\@thesistitle\undefined
{}
\else
\def\@title{\@thesistitle}
\fi
\typeout{New: \@title}
}

%% UPCASE{text): returns uppercase text accounting for embedded macros
%%
%% NOTE: This includes tracing which helps in diagnosing problems with expansion
\def\UPCASE#1{
   \typeout{Uppercasing `#1'}
   \def\upcasearg{#1}
   %% \def\result{\expandafter\uppercase\expandafter{\input}}
   \def\upcaseresult{\MakeUppercase{\upcasearg}}
   \typeout{Result: `\upcaseresult'}
   \upcaseresult
}

%% nmsutitlepage{}: Displays the title page for dissertation or thesis.
%%
\def\nmsutitlepage{%
   \ifx\@degree\undefined\traceout{ERROR: You must use \phddegree or \mastersdegree.}\fi
   %% Get local version of the title first checking \@thesistitle otherwise \@title
   %% NOTE: local definitions for title and author ensure that the
   %% uppercasing work properly (due to quirks of TeX macro expansion)
   \def\@thetitle{\@gettitle}
   \def\@theauthor{\@author}
   %%
   %% TODO: use EM rather than PC [pica] or IN for spacing
   %% \setlength{\baselineskip}{\doublespace}	%% double space it!
   \thispagestyle{empty}%
   \null\vskip1in%
   \begin{center}
      {\UPCASE{\@thetitle}}\\
      \bigskip
       BY \\
      \bigskip
      {\UPCASE{\@theauthor}}
   \end{center}
   \vfill
   \vfill
   \begin{center}
      A \@getthesistype\ submitted to the Graduate School\\
      in partial fulfillment of the requirements\\
      for the degree\\
      \@degree
   \end{center}
   \vfill
   \vfill
   \begin{center}
      Subject: \@getdept
   \end{center}
   \vfill
   \vfill
   \begin{center}
      New Mexico State University\\
      Las Cruces, New Mexico\\
      \@submitdate\\
      %% Copyright \@copyrightyear\ by \@author\\
      %% \copyright\, \@copyrightyear\ by \@author\\
      Copyright \copyright\, \@copyrightyear\ by \@theauthor\\
   \end{center}
   \vskip.5in
   \newpage
}



%%........................................................................
%% Approval page 


%% signature{text}: Create signature line with text immediately below line
%%
%% NOTE:
%% - No spacing after line as per guidelines under "Approval Page" below.
%% - The guidelines don't specify the actual line formatting but in the
%%   sample word document the line has top & bottom 1pt and left & right 4pt
%%   spacing.
%% TODO:
%% - Use \vspace{3pc} in place of \vspace{.5in}???
%% - Use \vspace{0.5pc} in place of \vspace{0.1in}???
\newcommand{\signature}[1]{
\vspace*{3pc}%%
%% \vspace*{2pt}%%
\hrule%%
%% \rule{5.75in}{1.5pt}
\vspace*{2pt}%%
\noindent%%
#1%%
\par%%
}

%% \approvalpage{}: Produce NMSU approval page for master's thesis or
%% dissertation.
%%
%% NOTE: The guidelines are a little vague with respect to the
%% approval page spacing, instead referring the users to the Word samples
%% available on the Guideline webpages.
%%
%% TODO:
%% - Straighten out interaction among \vfill's and \vspace's.
%% - Make the 'Dr.' prefix optional for master's advisors.
%% - Fix spacing hacks used with co-chair support: 1) enlargethispage used;
%%   and 2) only single line spacing after signature line (ie, 1pc not 2pc).
%% - Make sure enlargethispage only applies to current page.
%% 
\def\approvalpage{%
      %% Get local versions of title and author (see \nmsutitlepage above)
      \def\@thetitle{\@gettitle}%%
      \def\@theauthor{\@author}%%
      %%
\ifx\@firstcochair\undefined%%
\else
      \enlargethispage*{36pt}%%
\fi%%
      \noindent ``\@thetitle,'' a \@getthesistype\ prepared by \@theauthor\ in partial
      fulfillment of the requirements for the degree, \@degree,
      has been approved and accepted by the following:
      \vspace*{2pc}%%
      %%
      %% NOTE: Each signature line section occupies one inch at 12 points
      %%       (i.e., 6 text lines); \vspace{-1pc} adjusts for double spacing.
      \signature{\@dean\vspace{-1.25pc}\\Dean of the Graduate School}%%
      \vspace*{2pc}%%
%%
\ifx\@firstcochair\undefined%%
      \signature{\@chair\vspace{-1.25pc}\\Chair of the Examining Committee}%%
      \vspace*{2pc}%%
\else
      \signature{\@firstcochair\vspace{-1.25pc}\\Co-Chair of the Examining Committee}%%
      \vspace*{1pc}%%
%%
      \signature{\@secondcochair\vspace{-1.25pc}\\Co-Chair of the Examining Committee}%%
      \vspace*{1pc}%%
\fi%%
%%
      \signature{Date}%%
      \vspace*{1pc}%%
%%
      \noindent%%
      Committee in charge:\\%%
      %% note: there is no space after Chairman (see "Approval Page" below)
\ifx\@firstcochair\undefined%%
      \indent        Dr. \@chair, Chair\\%%
\else%%
      \indent        Dr. \@firstcochair, Co-Chair\\%%
      \indent        Dr. \@secondcochair, Co-Chair\\%%
\fi%%
      \indent        Dr. \@firstadviser\\%%
      \indent        Dr. \@secondadviser\\%%
      \indent        Dr. \@thirdadviser\\%%
\ifx\@fourthadviser\undefined%%
\else%%
      \indent Dr. \@fourthadviser\\%%
\fi%%
\ifx\@fifthadviser\undefined%%
\else%%
      \indent Dr. \@fifthadviser\\%%
\fi%%
      \newpage%%
}

%%........................................................................
%% Dedication page 

\def\dedication#1{\gdef\@dedication{#1}}
\def\dedicationpage{%%
  \begin{center}%%
    DEDICATION
  \end{center}%%
  \vspace{2pc}%%
  %% \indent
  \hspace{\parindent}%%
  \@dedication
 \vfill\newpage%%
}


%%........................................................................
%% Acknowledgements page 

\def\acknowledgments#1{\gdef\@acknowledgments{#1}}
\def\acknowledgmentpage{%%
  \begin{center}%%
    ACKNOWLEDGMENTS
  \end{center}%%
  \vspace{2pc}%%
  \hspace{\parindent}%%
  \@acknowledgments
 \vfill\newpage%%
}

%%........................................................................
%% Vita page 

\def\vita#1{\gdef\@vita{#1}}
\def\publicationsection#1{\gdef\@publicationsection{#1}}
\def\associationsection#1{\gdef\@associationsection{#1}}
\def\majorfield#1{\gdef\@majorfield{#1}}
\def\fieldofstudy#1{\gdef\@fieldofstudy{#1}}

\def\vitapage{
  \makesinglespaced
  \ifx\@vita\undefined
     \typeout{WARNING: omitting the VITA}
  \else
     \begin{center}
        VITA \\
     \end{center}
     \vspace{2pc}
     \noindent
     \makedoublespaced
     \@vita
  \fi

  \makesinglespaced
  \ifx\@associationsection\undefined
      \typeout{WARNING: omitting the professional associations}
  \else
     \begin{center}
        {\bf Professional Societies}\\
     \end{center}
     \makedoublespaced
     \noindent
     \@associationsection
  \fi

  \makedoublespaced
  \ifx\@publicationsection\undefined
      \typeout{WARNING: omitting the publications}
  \else
      \begin{center}
         {\bf Publications}\\
      \end{center}
      \makesinglespaced
      \@publicationsection
  \fi

  \makesinglespaced
  \ifx\@fieldofstudy\undefined
      \typeout{WARNING: omitting the field of study}
  \else
      \ifx\@majorfield\undefined
          \typeout{WARNING: \majorfield should be specified}
      \else
          \begin{center}
             {\bf Field of Study}\\
          \end{center}
	  \makedoublespaced
          \noindent
	  \begin{tabular}{@{}p{1in}@{\hspace{0in}}l}
	  Major field: & \@majorfield \\
		       &              \\
	               & \@fieldofstudy \\
	  \end{tabular}
      \fi
  \fi

  \makedoublespaced
  \vfill\newpage
}


%%........................................................................
%% Abstract page(s)

\def\theabstract#1{\gdef\@theabstract{#1}}

\def\abstractpage{
  %% Get local versions of title and author (see \nmsutitlepage above)
  \def\@thetitle{\@gettitle}
  \def\@theauthor{\@author}
  %%
  \begin{center}
     ABSTRACT\\
     \vspace{2pc}
     {\UPCASE{\@thetitle}}\\
     BY\\
     {\UPCASE{\@theauthor}}\\
     \par
     \vspace{2pc}
     %% NOTE: PhD just uses '<degree>' where as Masters used '<degree> in <Dept>'
\ifx\@isphd\undefined
     \@degree\ in \@getdept\\
\else
     \@degree\\
\fi
      New Mexico State University\\
      Las Cruces, New Mexico, \@copyrightyear \\
      Dr. \@chair, Chair\\
  \end{center}
  %% \indent
  \hspace{\parindent}
  \@theabstract
  \vfill\newpage
}


%%........................................................................
%% Support for chaptering
%%
%% NOTES:
%% - This implements a combination of the traditional chapter 
%%   format along with the decimal numbering system.
%% - The chapter and section headers are not in boldface
%% TODO:
%% - Have option to allow for boldface headers
%%

% NO Space at top of page.
% no title (for \chapter*}
%\def\@makeschapterhead#1{%
%}

\def\@makeschapterhead#1{ 
{
\bf
\begin{center}
    \uppercase{#1}\par  % In uppercase!
    \nobreak                    % TeX penalty to prevent page break.
     \par\par                   % Space between title and text.
\end{center}
}
}

%% put chapter names in all uppercase!
%% TODO: reconcille with latest version of report.cls
\def\@makechapterhead#1{%           % Heading for \chapter command
{
\bf
\begin{center}
\MakeUppercase{\@chapapp} \thechapter \\ %Print '\chaptername' and number.
    \uppercase{#1}\par  % In uppercase!
    \nobreak                        % TeX penalty to prevent page break.
     \par\par                   % Space between title and text.
\end{center}
}
}




%% Change section definitions to use regular font size, no boldface,
%% and also to add 1/2 indent for first paragraph.
%%
%% definitions from report.cls:
%% 
%% \newcommand\section{\@startsection {section}{1}{\z@}{-3.5ex \@plus -1ex \@minus -.2ex}{2.3ex \@plus.2ex}{\normalfont\Large\bfseries}}
%% \newcommand\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex\@plus -1ex \@minus -.2ex}{1.5ex \@plus .2ex}{\normalfont\large\bfseries}}
%% \newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex\@plus -1ex \@minus -.2ex}{1.5ex \@plus .2ex}{\normalfont\normalsize\bfseries}}
%%
%% TODO: get 1/2 indent for first paragraph
%%
%% \def\section{{\@startsection {section}{1}{\z@}{-3.5ex plus-1ex minus-.2ex}{2.3ex plus.2ex}{\normalfont\normalsize}{}}\hspace*{\parindent}}
%% \def\subsection{{\@startsection{subsection}{2}{\z@}{-3.25ex plus-1ex minus-.2ex}{1.5ex plus.2ex}{\normalfont\normalsize}{}}\hspace*{\parindent}}
%% \def\subsubsection{{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus -1ex minus-.2ex}{1.5ex plus.2ex}{\normalfont\normalsize}{}}\hspace*{\parindent}}
%%
\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus-1ex minus-.2ex}{2.3ex plus.2ex}{\normalfont\normalsize\bfseries}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus-1ex minus-.2ex}{1.5ex plus.2ex}{\normalfont\normalsize\bfseries}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus -1ex minus-.2ex}{1.5ex plus.2ex}{\normalfont\normalsize\bfseries}}

%% Make sure the first paragraph of each section is indented (as with others).
%% Taken from indentfirst.sty
\let\@afterindentfalse\@afterindenttrue
\@afterindenttrue


%% changecounter(name,value): Change value of counter NAME to VALUE,
%% 	displaying the old and new values in the log.
%% TODO:
%% - define flag for optional tracing
%% NOTE: count255 is a temporary counter that tex provides for macro use
%%
\def\changecounter#1#2{
\count255 = \value{#1}
\typeout{Changing #1 from (\the\count255) to (#2)}
\setcounter{#1}{#2}
}

%% Increase the maximum section number depth
\typeout{Increasing the maximum depth to include subsubsetions in contents}
\changecounter{secnumdepth}{3}
\changecounter{tocdepth}{3}

%% Change indentation of contents page
%%
%% ???Make sure the chapter table of content entries are not boldface
%%
%% NOTES:
%% - \@dottedtocline{depth}{indent}{width}: formats the (dotted) table
%%   of contents line
%%
%% definitions from report.cls:
%%    \newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
%%    \newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
%%    \newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
%%    \newcommand\@tocrmarg{2.55em}
%%    \newcommand\@pnumwidth{1.55em}
%%
%% hdp - uncomment the next line if need algorithms
%%\def\l@lchapter{\@dottedtocline{0}{0em}{1.5em}}
\def\l@chapter{\@dottedtocline{0}{0em}{1.5em}}
\def\l@section{\@dottedtocline{1}{1.5em}{2.5em}}
\def\l@subsection{\@dottedtocline{2}{4em}{3.5em}}
\def\l@subsubsection{\@dottedtocline{3}{7.5em}{4.5em}}
%%
%% Make right margin slightly larger to avoid text occurring beyond
%% position of last leader dots.
\renewcommand\@tocrmarg{3em}

\def\@chapter[#1]#2{
\ifnum \c@secnumdepth >\m@ne
        \refstepcounter{chapter}%
        \typeout{\@chapapp\space\thechapter.}%
        \addcontentsline{toc}{chapter}{\protect
        \numberline{\thechapter}\uppercase{#1}}\else
      \addcontentsline{toc}{chapter}{\uppercase{#1}}\fi
   \chaptermark{\uppercase{#1}}%
   \addtocontents{lof}%
       {\protect\addvspace{10\p@}}% Adds between-chapter space
   \addtocontents{lot}%
       {\protect\addvspace{10\p@}}% to lists of figs & tables.
   \if@twocolumn                  % Tests for two-column mode.  
           \@topnewpage[\@makechapterhead{#2}]%
     \else \@makechapterhead{#2}%
           \@afterheading         % Routine called after chapter and
     \fi                         % section heading.
   \hspace*{\parindent} 	%% 1/2 indent for first paragraph
   %% Workaround for table and figure counters not being reset
   %% TODO: figure out what is causing the problem
   \setcounter{table}{0}
   \setcounter{figure}{0}
   }


%%........................................................................
%% Table of contents, etc. page(s)
%% NOTE: this includes separate pages for List of Tables and List of Figures
%% TODO:
%% - Make sure that single spacing is if more than one line needed.
%% - Make sure that title does not extend past last leader dot.
%% - Make sure the appendix subsections are not shown.
%%

%% Hook into contentsline command to include a space after each entry.
%%
%% NOTE: The contents page is printed in single-spaced mode but there
%% needs to be a blank line between entries.
%%
\let\oldcontentsline = \contentsline
\renewcommand\contentsline[3]{
	\oldcontentsline{#1}{#2}{#3}
	\vspace{1pc}
	}

%% tableofcontentspage{}: display the table of contents as well as the
%% lists of tables and figures
%% hdp - algorithms (if need then uncomment)
%%
\def\tableofcontentspage{
  \chapter*{TABLE OF CONTENTS}
  \@starttoc{toc}

  %% add algorithms - hdp
  %%\listofalgorithms
  %%\addcontentsline{toc}{lchapter}{LIST OF ALGORITHMS}
  %%\@starttoc{loal}

  \chapter*{LIST OF TABLES}
  \addcontentsline{toc}{chapter}{LIST OF TABLES}
  \@starttoc{lot}

  \chapter*{LIST OF FIGURES}
  \addcontentsline{toc}{chapter}{LIST OF FIGURES}
  \@starttoc{lof}
}


%%........................................................................
%% Master macro for displaying all preliminary pages

%% \preliminarypages{}: display the following preliminary pages for
%% NMSU thesis: title page; singnature page; vita; abstract; and
%% table of contents.
%%
\def\preliminarypages{%%
        \pagenumbering{roman}%%
        \pagestyle{plain}%%
        \makedoublespaced%%
        \nmsutitlepage%%
	\parindent=0.5in%%
        \approvalpage%%
        \dedicationpage%%
        \acknowledgmentpage%%
        \vitapage%%
        \makedoublespaced%%
        \parindent=0.5in%%
        \abstractpage%%
        \makesinglespaced%%
        \tableofcontentspage%%
        \makedoublespaced%%
        \null\vskip1in%
	\newpage%%
        %% hdp - uncomment the next two lines if need blank page before start 
        %%       of actual thesis
        %%\null\vskip1in%
	%%\newpage%%
        \parindent=0.5in%%
	%% Make settings for the regular pages that follow%%
	\pagenumbering{arabic}%%
        \pagestyle{plain}%%
}

%%........................................................................
%% Global settings (needed in case \preliminarypages not used)
%% TODO:
%% - Put this up with margin changes.
%% - Set indentation for quotations as well.
%%
\parindent=0.5in
%% \listparindent=0.5in
%% \itemindent=0.5in
\makedoublespaced

%% Override quotation environments to handle proper block quoting
%%
%% definitions from report.cls:
%% \newenvironment{verse}
%%                {\let\\\@centercr
%%                 \list{}{\itemsep      \z@
%%                         \itemindent   -1.5em%
%%                         \listparindent\itemindent
%%                         \rightmargin  \leftmargin
%%                         \advance\leftmargin 1.5em}%
%%                 \item\relax}
%%                {\endlist}
%% \newenvironment{quotation}
%%                {\list{}{\listparindent 1.5em%
%%                         \itemindent    \listparindent
%%                         \rightmargin   \leftmargin
%%                         \parsep        \z@ \@plus\p@}%
%%                 \item\relax}
%%                {\endlist}
%% \newenvironment{quote}
%%                {\list{}{\rightmargin\leftmargin}%
%%                 \item\relax}
%%                {\endlist}
%% TODO:
%% - Try to define these in terms of the existing environments.
%%
\renewenvironment{verse}
               {\let\\\@centercr
                \list{}{\leftmargin\parindent%		%% only change
			\itemsep      \z@
                        \itemindent   -1.5em%
                        \listparindent\itemindent
                        \rightmargin  \leftmargin
                        \advance\leftmargin 1.5em}%
                \item\relax}
               {\endlist}
\renewenvironment{quotation}
               {\list{}{\leftmargin\parindent%		%% only change
			\listparindent 1.5em%
                        \itemindent    \listparindent
                        \rightmargin   \leftmargin
                        \parsep        \z@ \@plus\p@}%
                \item\relax}
               {\endlist}
\renewenvironment{quote}
               {\list{}{\leftmargin\parindent%		%% only change
			\rightmargin\leftmargin}%
                \item\relax}
               {\endlist}


%%........................................................................
%% Redefinition of bibliography layout
%%
%% Differences from standard environment:
%% - forces use of single spacing
%% - the use of 'REFERENCES' rather than 'BIBLIOGRAPHY'
%%

\newcommand\refname{References}

\def\thebibliography#1{\chapter*{\MakeUppercase\refname\@mkboth
  {\MakeUppercase\refname}{\MakeUppercase\refname}}
  \addcontentsline{toc}{chapter}{\MakeUppercase\refname}
  \makesinglespaced
  \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
}

%%........................................................................
%% Macros for user convenience
%%
%% ENABLEWIDOWCONTROL{}:	set widow/orphan control on
%% APPENDIX{}:			start appendix section
%%
%% NOTE: These are workarounds to my not figuring out how to handle this
%% in the style file.
%% TODO:
%% - get the table-of-contents depth change to work (only in preamble???)
%%
\newcommand\ENABLEWIDOWCONTROL[1]{\clubpenalty=10000\widowpenalty=10000}

\newcommand\APPENDIX{
	\appendix
	\chapter*{APPENDICES}
	\thispagestyle{empty}
	\addcontentsline{toc}{chapter}{APPENDICES}
	\changecounter{tocdepth}{0}
	}

%%------------------------------------------------------------------------
%% Latex/tex reference
%%
%% description of some of the Latex or Tex commands used in the style
%% file. Most of the descriptions were taken from the Hypertext Help with LaTeX:
%%     http://aether.lbl.gov/www/manuals/latex/index.html
%%
%% TODO:
%% - add description for all lesser-known commands used

%% \newlength{\gnat} 
%%
%% The \newlength command defines the mandatory argument, \gnat, as a
%% length command with a value of 0in. An error occurs if a \gnat
%% command already exists. 
%%
%% \setlength{len-cmd}{len} 
%%
%% The \setlength command is used to set the value of a length command,
%% len-cmd, which is specified as the first argument. The len argument can
%% be expressed in any terms of length LaTeX understands, i.e., inches
%% (in), millimeters (mm), points (pt), etc.
%%
%% \baselineskip \baselinestretch
%% \baselineskip is a length command which specifies the minimum space
%% between the botton of two successive lines in a paragraph. Its value
%% may be automatically reset by LaTeX, for example, by font changes in
%% the text. The value used for an entire paragraph is the value in
%% effect at the blank line or command which ends the paragraph unit. 
%%
%% \baselinestretch scales the value of \baselineskip. Its default value
%% is 1.0 but it may be reset with a \renewcommand command. If one wants
%% to change the spacing in a document one should reset \baselinestretch
%% and not \baselineskip as the latter may be reset automatically by
%% LaTeX to account for local variations in the text, but it is always
%% scaled by the former. In principle, "double spacing" can be obtained
%% by \renewcommand{\baselinestretch}{2}.
%%
%%........................................................................
%% from mathweb.mathsci.usna.edu/faculty/traveswn/ publications/ajour.cls.htm:
%%
%% Description of parameters having to do with float placement:
%%  \c@topnumber            : Number of floats allowed at the top of a column.
%%  \topfraction            : Fraction of column that can be devoted to floats.
%%  \c@dbltopnumber, \dbltopfraction : Same as above, but for double-column
%%                          floats.
%%  \c@bottomnumber, \bottomfraction : Same as above for bottom of page.
%%  \c@totalnumber          : Number of floats allowed in a single column, 
%%                          including in-text floats.
%%  \textfraction         : Minimum fraction of column that must contain text.
%%  \floatpagefraction    : Minimum fraction of page that must be taken
%%                          up by float page.
%%........................................................................
%% from http://www.tug.org/pipermail/tugindia/2002-January/000178.html
%%
%% \makeatletter changes the category code of '@' character to 11 
%% (which is the catcode of ordinarary characters a-z,A-Z). 
%% \makeatother reverts this to its original catcode of 12.   
%%
%% This raises the problems of risks of an user defined macro having
%% the same name as that of a macro in a package or even LaTeX kernel.  
%% even. This can break down packages. 
%% ...
%% In order to circumvent this foreseeable problem, package writers
%% always use the character '@' in their control sequences by changing
%% the cat code of `@' character to 11 which is the catcode of alpha
%% characters. This is accomplished by the command \makeatletter. 
%%
%% At the end of the package, the author will revert the catcode of `@'
%% to 12 with the command \makeatother.
%%
%%........................................................................
%% from http://www.tug.org/utilities/plain/cseq.html#expandafter-rp:
%%
%% \expandafter<token1><token2>
%%
%% THE construction `\expandafter<t1><t2>' is equivalent to `<t1>
%% expansion of <t2>'. TeX does not expand <t1> until after it
%% expands <t2>. 
%%

%%------------------------------------------------------------------------
%% Excerpts from NMSU Guidelines for Preparing a Thesis or Dissertation:
%%     http://www.nmsu.edu/~gradcolg/Guidelines/index.html
%%
%% Margins Guidelines:
%%
%% 1.50" left margin (binding margin) 
%%  
%% 1.25" top and right 
%%  
%% 1.0" from the bottom edge of the page for the page number. This will
%% leave a 0.25" space between the page number and the last line of
%% text. See "standard typing rules" for exception to the .25" margin. 
%%  
%% All pages, including figures, tables, and appendix material must
%% conform to the margin requirements. If wide tables or figures require
%% the page to be in the landscape position, the tops of the
%% figures/tables must be at the binding edge--the side with the 1.50"
%% margin. The page number will remain in the portrait position. 
%%
%%........................................................................
%% Line Spacing guidelines:
%%
%% Single spacing means press enter once with the spacing set on single;
%% double spacing means press enter once with the spacing set on double.  
%%
%% Use 6 lines per vertical inch. Word processors like Word and
%% WordPerfect are automatically set to this requirement. If your word
%% processing program requires you to set the leading make sure that you
%% set it to an equivalent value of 6 lines per inch. In double spaced
%% text this is 3 lines of text and 3 blank lines. In single spaced text
%% this will be 6 lines of type. Text with fewer than or more than 6
%% lines per inch will be rejected.  
%%
%% Double space the text. 
%%
%% Single space: Block quotations; table/figure captions; table/figure
%% notes but double space between notes; entries in the reference list
%% but double space between entries; headings that are typed on more
%% than one line; all listings in the Contents, List of Tables, and List
%% of Figures that require more than one line, but double space between
%% subheadings and each table/figure caption; itemized lists may be
%% single spaced but double space between items.  
%%
%% Single or double space appendix material and tables. Let readability
%% of these items be your guide in whether to single space or double
%% space. You may choose to single space some appendix material or a
%% table and double space others.  
%%
%%........................................................................
%% Indenting 
%%
%% Paragraphs. Indent the first line of all paragraphs .50 " or use the first default tab in Word or WordPerfect. 
%%
%% Begin second and subsequent lines of the paragraph at the left margin (1.50"). 
%%
%% Block quotes. Indent all lines of block quotes (setoff quotations) .50" from the left margin and type the entire quotation on the indented margin. Single space all lines. If the quotation is more than one paragraph, indent the first line of this second paragraph (and any subsequent paragraphs) an additional .50" from the new margin. 
%%
%% Block quotes may be material you quote from interviews or material from open-ended questions from your data collection instrument as well as from published or unpublished sources. 
%%
%%........................................................................
%% Font Types 
%% Fonts are basically two types--proportional and fixed (typewriter style). 
%%
%% Proportional fonts have a different space value for each character (that is why text cannot be aligned by using the space bar). More text will fit on a page with a proportional font than with a fixed font. Most of the fonts in use today are proportional (Arial, Times New Roman are just two examples). If you are using a proportional font for your thesis you must use at least a 12-point font. 
%%
%% Fixed fonts or typewriter style fonts have the same space value for every character. An example of this is Courier. If you use a fixed font the smallest you can use for your text is 10 (10 characters per inch) Use a ruler to count the characters to make sure that you really do have 10 characters per inch. 
%%
%%........................................................................
%% Chapter/Section Titles and Subheadings:
%%
%% The paper usually includes an introduction that justifies a need for the
%% research, a literature review, materials and methods section, results
%% and discussion, and conclusions. The thesis or dissertation must be
%% divided into chapters (or sections), which may then be subdivided, with
%% informative titles that correspond with the main heads and subheads
%% listed in the Table of Contents. 
%%
%% Not all theses or dissertations will require all levels, but all
%% levels used must be listed in the Table of Contents. There must be at
%% least two subheads at any one level. 
%%
%% Subheadings can be used in any descending order after the chapter title.
%%
%%
%% Do not boldface and underline or italicize and underline any
%% heading. Use just boldface, just italics, or just underlining on all
%% levels. You can also use plain type and underlining for all headings
%% below the chapter title if you wish although the boldface headings
%% stand out better. 
%%
%% Notice that headings do not extend from margin to margin--this spacing is used to display the headings and provide better separation of headings from text or another heading. 
%%
%% The horizontal limit for a centered heading is 4.5". When you reach that point begin another line for the heading and make that line shorter than the first line and continue in inverted pyramid style until the title is complete. 
%%
%% For side headings the horizontal limit is 2.50". Begin second and subsequent lines at the left margin. 
%%
%% Single space all headings.
%%
%% Each new chapter or chapter equivalent must start on a new page. Do not begin a new page for a subheading. The exception to this would be to avoid having a heading as the last line of text on a page.
%%
%% Decimal subheads may or may not be indented because the numerals, not the indentation, tell the reader the level.
%%
%% Good writing dictates that there not be more than two headings without intervening text. Three consecutive headings with no text between are never acceptable.
%%
%% These headings are the same as those described in the APA Manual and Turabian.
%%
%% Heading Styles 
%%
%% Three styles of chapter/section titles and headings are commonly used. These are: (1) the chapter heading/chapter title/subheading method (2) the section title/subheadings method, and (3) the decimal system. 
%%
%% Chapter heading/chapter title/subheading system is the traditional format for theses and dissertations.
%%
%%                           CHAPTER 1
%%     TYPE THE CHAPTER TITLE IN INVERTED PYRAMID STYLE IN ALL
%%           CAPS AND SINGLE SPACE BETWEEN THE LINES
%%
%%         First level: This Is a Centered Heading with All
%%                Major Words Capitalized, Typed Single
%% ...
%% Decimal System is usually used in disciplines such as engineering, chemistry, biology, mathematics, physics, astronomy, agriculture, computer sciences, and so on. 
%%
%% 1. UPPERCASE CHAPTER TITLE 
%%
%% 1.1 Upper/Lowercase Subhead 
%%
%%
%%........................................................................
%% Preliminary Pages
%%
%% Use lowercase roman numerals for all of the preliminary pages: 
%%
%% i Title page (numeral i is assigned but not shown on the page). The
%%   copyright notice is placed at the bottom of this page if you are copyrighting.
%% ii Approval page (signature page) 
%% iii Dedication page (optional) 
%% iv Acknowledgment or Preface (optional) 
%% v Vita 
%% vi Abstract 
%% vii Table of Contents or Contents 
%% viii *List of Tables or Tables (includes appendix tables) 
%% ix *List of Figures or Figures (includes appendix figures) 
%% x *Data on Compact Disc 
%% xi *List of Abbreviations (or Nomenclature or List of Symbols) 
%%
%% (*Not all theses/dissertations will have a copyright notice, tables,
%%  figures, CDs, or special nomenclature) 
%% 
%% 
%% Title Page
%% 
%% The title page will show the title--200 letters and spaces, or
%% less--typed in inverted pyramid style, double spaced, and in uppercase
%% letters with all symbols written as words.
%% 
%% Type your name as it appears on your official university records,
%% followed by previous degrees you have been awarded.
%% 
%% Name changes must be processed through the Office of the Registrar.
%% 
%% The degree title (as shown on page 2 of the Graduate Catalog).
%% 
%% Major subject must be worded as shown on p. 2 of the Graduate Catalog;
%% list a minor subject only if one is shown on the program of
%% study. Minors and specializations may be shown here ONLY if they appear
%% on the list of minors and specializations approved by the university.
%% 
%% University name, city, state.
%% 
%% The month and year of graduation--four dates are used: May for spring,
%% July for summer I, August for summer II, and December for fall).
%% 
%% If you copyright your work, place the word "Copyright" or the
%% international symbol, the year of publication, and your name as it
%% appears on your thesis or dissertation on the next double spaced line
%% after the date line (Copyright or © 1999 by Jane Anne Doe).
%% 
%% The title page is number i, but do not print the number on this page. 
%% 
%% Do not type anything on this page in boldface. 
%% 
%% Approval Page (Signature Page) 
%% 
%% Double space all lines on this page except the information immediately
%% below the horizontal lines.
%% 
%% Do not use boldface for anything on this page except titles of published
%% works, genus species names, and similar items.
%% 
%% The first paragraph must be worded the same way here as it appears on
%% the sample pages. Begin at the left margin and type the title in upper-
%% and lower-case letters. Enclose the title in quotation marks being sure
%% to place the end quote mark after the comma.
%% 
%% List your name as it appears on your official university records.
%% 
%% Follow the format of the signature lines for the graduate dean, your
%% chair or co-chairs (the horizontal line and their names), and the date
%% 
%% Under "Committee in charge:" list the chair's name first (Dr. Elizabeth
%% T. Jones, Chair). If you have co-chairs (Dr. Elizabeth T. Jones,
%% Co-Chair, then a double space below, Dr. John E. Jones, Co-Chair).
%% 
%% After listing the chair or co-chairs list the committee members in
%% alphabetical order, by last name, after the chair (adviser). Double
%% space between the names.
%% 
%% Be sure to use first names, middle initials, and last names of all
%% committee members. Use the abbreviation "Dr." (not Doctor and put a
%% period after the abbreviation) if he/she so be. If a committee member
%% does not have a doctoral degree, use the courtesy title of Mr. or Ms.,
%% and the member's full legal name followed by the degree abbreviation
%% (e.g., Ms. Jane Y. Smith, M.S.W.).
%% 
%% 
%% Dedication Page
%% 
%% This page is optional.
%% 
%% Type the word DEDICATION (in plain type not bold) 1.25" from the top of
%% the page, insert two double spaced blank lines and begin the
%% text--double spacing all lines and indenting the first line of every
%% paragraph.
%% 
%% 
%% Acknowledgment Page or Preface
%% 
%% This page is optional.
%% 
%% Type the word ACKNOWLEDGMENTS (in plain type not bold) 1.25" from the
%% top of the page, insert two double-spaced blank lines and begin the
%% text--double spacing all lines. Indent the first line of every
%% paragraph.
%% 
%% The acknowledgment is the place to thank the faculty, staff, family, and
%% friends who have assisted you in preparing your thesis or
%% dissertation. You may also acknowledge any financial support or special
%% research materials given you.
%% 
%% Copyright permissions may also be acknowledged here by stating that: (1)
%% permission has been granted for reproduction of tables, tests, and other
%% copyright protected items and (2) gives the source of the permission.
%% 
%% Use a PREFACE rather than Acknowledgments when the research is
%% discussed, for example, "the motivation for the study, the background of
%% the project, the scope of the research, and the purpose of the paper"
%% (Turabian, 1996, pp. 7-8).
%% 
%% 
%% 
%% Vita 
%% 
%% Type the word VITA (in plain type not bold) 1.25" from the top of the
%% page, insert two double-spaced lines and begin. This is a vita--a simple
%% biographical sketch focusing on your academic and professional
%% accomplishments--not a curriculum vitae. Use a simple chronological
%% order.
%% 
%% Publications listed must be in standard bibliographical form--single
%% spaced with a double space between items, and with a hanging indent
%% (first line at the left margin, second and subsequent lines indented
%% .50".
%% 
%% 
%% 
%% Abstract
%% 
%% Do not use any boldface on this page.
%% 
%% Type the word ABSTRACT 1.25" from the top of the page. Type the title in
%% uppercase letters (200 words and spaces maximum and with all symbols
%% written as words) in inverted pyramid style, the student's name as it
%% appears on the official records in the Office of the Registrar, the
%% degree title, the full name of this university, city, state, year, and
%% name of adviser (chair) or advisers if there is a co-chair.
%% 
%% Double space all lines and indent the first line of all paragraphs .50".
%% 
%% The abstract must have a (1) statement of the problem, (2) an exposition
%% of methods and procedures, and (3) a summary of the findings.
%% 
%% The length may not exceed 350 words.
%% 
%% 
%% Table of Contents 
%% 
%% Tables of Contents vary depending on the style used for the thesis or
%% dissertation. Papers with numbered headings or section titles will vary
%% somewhat from those papers using the traditional chapter number and
%% chapter title format. Most word processors have an automatic generation
%% feature for compiling the contents,list of tables, and list of
%% figures. If these features are used,these pages will need to be edited
%% manually so that they conform to the styles shown in the Guidelines.
%% 
%% In general, however, the following guidelines will apply to all papers,
%% regardless of the style used within for headings. Consult the sample
%% pages for examples of the correct styles.
%% 
%% Do not use boldface in the table of contents. 
%% 
%% Type TABLE OF CONTENTS or CONTENTS 1.25" from the top of the page. Begin
%% with the List of Tables, the List of Figures is next, followed by list
%% of data on a CD, lists of nomenclature, abbreviations, and so on.
%% 
%% Do not list any of the material that precedes the Table of Contents (do
%% not include the Vita, Acknowledgments, Abstract, etc.).
%% 
%% If the paper does not have tables or figures, the first listing is for
%% chapter 1 or the introduction.
%% 
%% 
%% Include all chapter heads (or chapter equivalents, frequently called
%% section headings) in all uppercase letters and ALL subheads using the
%% same wording and capitalization as that given in the text.
%% 
%% There must be at least two subheads at any level.
%% 
%% List Appendices next. 
%% 
%% Each appendix must be designated with a letter or numeral and a
%% descriptive title. Double space between each title. Single space titles
%% longer than about 4" in length and/or that require more than one line.
%% 
%% 
%% The Bibliography, Literature Cited, Sources Consulted, and so on is
%% listed next.
%% 
%% Do not include more than one reference list at the end of the paper.
%% 
%% 
%% List of Tables (Figures) 
%% 
%% Place each list on a separate page with the table or figure title
%% followed by dot leaders and a page number at the right margin.
%% 
%% Double space between each caption but single space captions longer than
%% one line.
%% 
%% Number all tables/figures consecutively from chapter 1 through the last
%% chapter of the thesis unless the sections of a paper are numbered then
%% decimal numbering may be used for the tables and figures.
%% 
%% 
%% Appendix Tables/Appendix Figures 
%% 
%% Tables and figures placed in an appendix will be listed in the List of
%% Tables/List of Figures immediately following the last text
%% table/figure. For example, 15, A1, A2, B1, and so on. This same method
%% applies to appendix figures (18, C1, D1, and so on).
%% 
%% Do not add extra spaces between table and figure listings for separate chapters. Just continue to double space between each caption. 
%% 
%% Do not use separate lists for tables and figures in the appendices. 
%% Data on a CD
%% 
%% 
%% 
%% Large quantities of raw data, oversize materials, complex tables,
%% spreadsheets, and so on may be included on a compact disc. See the
%% format for this list in the sample pages.
%% 
%% The list of references will be the last element of the thesis.
%%........................................................................
%%
%% 
%% Back Matter
%% 
%% The back matter consists of the appendices and the reference list in
%% that order. Page numbers continue as arabic numerals for all back
%% matter:
%%   
%%   
%% Half Title Pages
%% 
%% Half title pages are typically used before the appendix and reference
%% sections of theses and dissertations as divider pages.
%% 
%% A half title page is required before the appendix section. It is
%% optional before each appendix, but if one is used for any appendix then
%% one must be used for all.
%%   
%% 
%% The half title page for the appendix section will have APPENDIX or
%% APPENDICES (as appropriate) typed in all caps and centered. It may be
%% optically centered on the page. Count the page in the pagination
%% sequence but do not print a page number on it.
%%   
%% Half title pages for individual appendices will have the words APPENDIX
%% A (B, C and so on) typed all in caps at the top of the page, centered a
%% double space below type the title, double spaced, and in inverted
%% pyramid style. Count the page in the numbering sequence but do not print
%% a page number on it.
%% 
%% If you do use the half-title page, be sure to list the page number in the table of contents as that of the half-title page. 
%%   
%% 
%% Do not place a page number on the half title page but do count it in the
%% pagination sequence.
%%  
%% Appendix 
%% 
%% The appendix (or appendices, if more than one) are labeled as APPENDIX
%% A, APPENDIX B, etc., with descriptive titles given for each. You may use
%% half-title pages which carry the appendix label and descriptive title
%% (typed centered in inverted pyramid style and in all caps) before the
%% actual appendix material or you may simply place the appendix label and
%% descriptive title at the top of the page (top margin 1.25"), double
%% space, then start the actual appendix material.
%%   
%% Remember to observe the margins and the page numbering requirements. Use
%% arabic numerals, numbered consecutively with the text.  Bibliography;
%% References; Literature Cited; References Cited A bibliography is a list
%% of works, including electronic sources, used as reference materials. A
%% bibliography may contain works read for background information in
%% addition to those works actually cited in the paper. Check with your
%% committee chair to find out if you may use the bibliography listing.
%% 
%% The majority of disciplines require that all entries be cited. If you
%% use the Literature Cited (LC), References Cited (RC), Works Cited
%% format, you must cite every work listed.
%% 
%% The graduate school does accept the reference style of major journals in
%% the various disciplines. If the department has not specified a journal
%% style to follow, use the APA Manual or the parenthetic reference (PR)
%% style from Turabian.
%% 
%% While the name of the reference section varies according to the
%% discipline involved, the following conventions must be observed in
%% theses.
%% 
%% Single space all lines of each entry but double space between entries.
%%   
%% If the author's name is unknown do not use Anonymous. Alphabetize the entry by the first principal word in the title (never alphabetize by "a," "an," or "the." Use the next word in the title. 
%%   
%% For multiple works by the same author, list the earliest date first.
%%   
%% When the same author writes with others, these entries follow the
%% single-authored work, alphabetized by the second surname.
%%   
%% Multiple entries by the same authors in the same year, are
%% differentiated by adding "a" and "b" after the dates (Jones, 1992a).
%% Using Numbered Reference Lists You may arrange entries alphabetically by
%% surname and then number the list. This method results in random numbers
%% in the text.
%% 
%% Another method is to assign a number to each work as it is cited in the
%% text and then prepare the reference list in numerical order. This method
%% will result in a random-order bibliography but the citation numbers in
%% the text will be in numerical order.
%% 
%% Either method of numbering is acceptable as long as it is used correctly
%% and consistently throughout the thesis.
%%........................................................................
%% TODO: include other guidelines from the graduate school:
%% ex: http://www.nmsu.edu/~gradcolg/Guidelines/tables.html
%% 
%%........................................................................
%% http://www.nmsu.edu/~gradcolg/Guidelines/msformat.html
%%
%% Manuscript Requirements--Common Errors
%%
%% The information contained in this section is not unique to theses and
%% dissertations--it is standard grammatical and typing practice. Because
%% the candidate is expected to already know much of this information,
%% what is presented is only the most troublesome points. Please consult
%% one of the recommended style manuals or any grammar book for more
%% information.
%%
%% General Errors
%% 
%% Not reading and following the NMSU Guidelines for Preparing a Thesis
%% or Dissertation.
%%   
%% Not reading and following a style manual. If one has not been
%% specified by your department use either Kate Turabian, A Manual for
%% Writers of Term Papers, Theses, and Dissertations, 6th ed. or the
%% Publication Manual of the American Psychological Association
%% 5thed. for general information.
%%   
%% Using another thesis/dissertation as your style guide.
%%   
%% Not being familiar with the word processing program being used. If you
%% are using style sheets or templates you must be able to change the
%% defaults built into them so that the finished document conforms to
%% NMSU Guidelines.
%%   
%% Not being familiar with common journal formats used in your field.
%% Numerals versus Words Disciplines vary in the way in which numerals
%% are written. Some write as a word any number under 10 while others
%% require that all numerals up to 100 be written as words. Then many
%% exceptions exist to these two styles.
%%   
%% Use the style of your discipline when writing numerals. If your
%% discipline does not clearly define a style then use the APA Manual or
%% Turabian as a guide for when to write a number as a word or as a
%% numeral.
%%   
%% Never begin a sentence with a number written as a numeral. Spell it
%% out or reword the sentence so that a number does not begin a
%% sentence. This applies to chemical compounds and other terms which
%% commonly begin with a numeral.
%%   
%% Numerals are always used for the following: Dates; time; ages; sample,
%% subsample, or population size; exact sums of money; numbers that
%% immediately precede a unit of measurement; statistical or mathematical
%% functions; fractional or decimal quantities, percentages, ratios.
%%   
%% Two digit numerals written as words must be hyphenated (twenty-five
%% not twenty five).  Punctuation Be consistent with comma usage.
%%   
%% It is acceptable to use or NOT use a comma before the final
%% conjunction in a series (cats, rats, and dogs OR cats, rats and
%% dogs). However, students following APA and MLA must use the comma.
%%   
%% Not typing hyphens and dashes correctly--do not use a space before or
%% after a hyphen or a dash.
%%   
%% 5 - 23 is a minus; 5-23 is a range although the word "to" is now
%% preferred in some disciplines.
%% 
%% 
%% a hyphen (sometimes called an "en" dash) is also used to divide
%% words--self-concept not self- concept or self - concept.  A dash
%% (sometimes called an "em" dash) is two hyphens typed together with no
%% spaces before, between, or after--it represents a break in thought or
%% another method of adding emphasis or clarity to sentence
%% structure. The dash is overused so consider using another punctuation
%% mark.
%%   
%% Do not use two periods after an abbreviation that comes at the end of
%% a sentence (We shopped at Acme Co. not Co.., for example).  Latin
%% Abbreviations Some Latin abbreviations have been anglicized and are no
%% longer italicized or underlined--these include et al., i.e., e.g.,
%% etc., cf., ibid. (the use of ibid. is now discouraged by most style
%% guides), and many others. Consult a good dictionary--if the term is
%% listed there it should not be italicized (Turabian, 1996:72).
%% 
%% et al. means "and others"; et is not an abbreviation, al., standing
%% for alia, is an abbreviation so the term is written as et al. with no
%% italics, bold, or underline.
%% 
%% Check your manuals or journal style for when you can use et al.--some
%% disciplines say with 2 or more authors, others say 3 or more.
%% 
%% 
%% Using et al.'s is not acceptable. Instead of writing "Smith et al.'s
%% study" rewrite the citation read "the work of Smith et al." or
%% something similar.  Statistical Symbols Statistical symbols must be
%% italicized or underlined in text, tables, figures, and appendices. The
%% APA Manual discusses this extensively and contains numerous
%% examples. Some journals in their instructions to authors also provide
%% good treatments for preparing statistical copy. If your journal does
%% not provide this, then follow the APA Manual.
%% 
%% The symbol for chi-square is never italicized. Using the letter "x" to
%% represent the chi symbol is not acceptable. Use the chi symbol from
%% the symbols available in your word processor or write the word "chi."
%% 
%% Font Errors
%% 
%% Not having page numbers in the same font style and size as the text.
%%   
%% Putting headings or captions in a different size font than the text.
%%   
%% Not using the same font size and style as the text for footnotes.
%%
%% Page Layout Errors Incorrect pagination--can consist of page number
%% being in the incorrect location or counting errors.
%%   
%% Incorrect margins.
%%   
%% Not turning on widow and orphan control. This will prevent just one
%% line of a paragraph from appearing at the bottom or top of a
%% page. There must always be two lines of a paragraph at the bottom of
%% the page or carried over to the top of the following page.
%%   
%% A heading at the bottom of the page must be followed by two lines of
%% text. If it won't fit then move the heading to the next page.
%%   
%% Not filling all pages with text. If a table or figure will not fit
%% below where it is first mentioned, continue text to fill that page and
%% place the table or figure on the following page. A table begun on a
%% page with text must be complete on that page (see Turabian, 1996,
%% sec. 6.18, p. 94).
%%   
%% Not following standard typing and other scholarly conventions.
%% Documentation Errors Not checking for agreement between references
%% cited in the text against the same reference in the reference list.
%%   
%% Not following your manual or journal style for how to arrange the
%% reference list (an author who has works published as a single author
%% and works with co-authors, oldest publications listed first, and so
%% on).
%%   
%% Not using issue number when a journal paginates beginning with page 1
%% in each issue.
%% 
%% 
%% Not being consistent in the reference list (abbreviation of journal
%% titles, using vol. or Vol. or not using vol. at all, and so on).
%%   
%% Not using the same font size and style as the text for footnotes.
%%
%% Ellipses Ellipses are typed as three spaced periods: . . . not ...; a
%% fourth period represents the end of the sentence and indicates that
%% the sentence ended and then material was omitted. . . . or that part
%% of the sentence was omitted . . . . Note the spacing before the first
%% period.
%% 
%% Quotation Marks
%% 
%% Not typing quotation marks correctly--always place quotation marks
%% after periods and commas (commas," for example) and before colons and
%% semicolons (semicolons": for example). If you are using a single quote
%% mark the rule is the same.
%%   
%% For exclamation and question marks the quote marks may be placed
%% before or after depending on the context of the sentence. Any grammar
%% book or style manual will have detailed explanations of this as well
%% as examples.  Quotation Marks with Citations Quotation marks with
%% reference citations take different forms.
%% 
%% Run into the text--the last word of the quote" (Jones, 1995, p. 137).
%%   
%% At the end of a block quote. (Jones, 1995, p. 137) Capitalization
%% Remember to capitalize forms of the verb "to be" in headings,
%% reference lists, and table/figure captions when all major words in
%% those items are capitalized.
%%   
%% Capitalize consistently (do not capitalize a word or term in one place
%% and not another).
%%   
%% Do not capitalize for emphasis. Follow standard rules of capitalizing.
%% It's or Its Using "it's" for "its" is probably the most common error
%% made in theses and dissertations.
%% 
%% It's means it is. It's a contraction.
%%   
%% Its is a pronoun. Its is already possessive and, therefore, never
%% takes an apostrophe.  These items are all standard academic practices
%% and will be found, along with many others, in any style guide or
%% grammar book.
%% 
%%  
%% Last modified: October 10, 2001
%% 
%%........................................................................
%% TODO: include summary of standard typing rules for manuscripts
%%
%%........................................................................
%% Other requirements mentioned by the graduate editor
%%
%% Approval Page:
%% - No space after committee-in-charge line.
%% - No space after the signature line.
%% Title page:
%% - Use lowercase for 'degree' in "for the degree" on title page.
%% - The date must be that for commencement not the defense.
%% Vita page:
%% - Must use two-column format (no expository text).
%% - Subsection titles use mixed-case boldface font (not capitals).
%% - Use 'Publications' not 'Technical Publications'
%% - Must include 'Field of Study' section.
%% Abstract page:
%% - For PhD, just use 'Doctor of Philosophy' (not 'Doctor of Philosophy in Computer Science')
%% - For Masters, use 'Master of Science in Computer Science')
%% Table of Contents page:
%% - No part of the headings should extend past the leader dots.
%% - Single space multiple-line entries.
%% - Subsections for appendices are not included.
%% Other pages:
%% - Footnotes on same page have space between them.
%% - Footnotes must not use smaller font size (i.e., same as text).
%% - Comma's and period's go withing double quotes.
%% - A single line of a paragraph should not be "orphaned" (i.e.,
%%   occur by itself on one page with rest on another).
%%
%% Other requirements mentioned by Karen Villaverde:
%% - Cite everything very well.
%% - The ending of all pages needs to have at least 2 lines. If the ending
%%    of a page has a paragraph with 1 line, they will give you problems.
%% - Captions of all figures need to be less than 1 line.
%%   NOTE: This applies just for the table of contents
%%   (see www.nmsu.edu/~gradcolg/Guidelines/tables.html#Table%20Captions).
%%



