%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Thesis style to be used in conjunction with the companion %
% "thesis_template.tex".  It is intended to format a thesis %
% or dissertation in accordance with the current (2007)     %
% Thesis/Dissertation Guidelines from the Graduate School   %
% at Texas Tech University                                  %
% (http://www.depts.ttu.edu/gradschool/current/thd.php).    %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Report any problems to Robert Byerly, Department of       %
% Mathematics and Statistics, Texas Tech University         %
% (robert.byerly@ttu.edu)                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This has *not* yet been tested "under fire", i.e., on a    %
%dissertation that has actually been approved by the grad   %
%school.  If you use it, *please* report any formatting     %
%issues to robert.byerly@ttu.edu.                           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\def\filename{SimpleTTUThesis}
\def\fileversion{1.2}
\def\filedate{2007/6/23} 
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{SimpleTTUThesis}[\filedate\space\fileversion\space%
       LaTeX document class.]

\LoadClass[oneside,openany,12pt]{book}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Margin  settings -- Some may need to be adjusted.     %
% (Tried the geometry package, but it lacked           %
%  flexibility).              
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\setlength{\voffset}{0in}
%\setlength{\topmargin}{0pt}
%\setlength{\hoffset}{0.5in}
%\setlength{\oddsidemargin}{0pt}
%\setlength{\textwidth}{6in}
%\setlength{\textheight}{8.1in}
%END SETTINGS FOR MARGINS

%To get the double spacing or 1.5 spacing the
%grad school wants:
\RequirePackage{setspace}
\doublespacing  %(or use \onehalfspacing in the document preamble.)

%The grad school doesn't like right-justification, but Latex is smart enough
%to do right justification so use it.
%\raggedright
%\setlength{\parindent}{1em}


% Helpers to format the list of committee members on the title page 
\newcommand{\ThesisCommitteeMember}[1]{{#1}\\[5pt]}
\newcommand{\ThesisCommitteeChair}[1]{%
{#1}\\{\footnotesize Committee chair}\\[5pt]}
\newcommand{\ThesisCommitteeCoChair}[1]{%
{#1}\\{\footnotesize Co-chair}\\[5pt]}
\newcommand{\ThesisCommitteeDean}[1]{%
{#1}\\{\footnotesize Dean of the Graduate School}\\[12pt]}


% Nomenclature
\RequirePackage{nomencl}

%To get the header
\headheight15pt %Makes fancyhdr happy
\RequirePackage{fancyhdr}
\lhead{}\chead{}
%\rhead{} should be customized in the document preamble
\pagestyle{fancy}

%%%%%%%%%%%%%%%%%%%%%%%%%
%For the copyright page %
%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\copyrightpage}[0]{%
\thispagestyle{empty}
\vbox to \textheight{
\vfill
\hfil\copyright\thesisyear ,\thesisauthor \hfil
\vfill}
}

%Graduate school doesn't want a colon after
%"Figure n" in figure and table captions.
%How about a period?
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{#1. #2}%
  \ifdim \wd\@tempboxa >\hsize
    #1. #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Some of the stuff from here on is modified from an earlier %
%style file for theses written by an unknown person.        %
%Thanks! whoever you are!                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\renewcommand{\frontmatter}{%
   \if@openright
      \cleardoublepage
   \else
      \clearpage
   \fi
   \@mainmatterfalse
   \pagenumbering{roman}            %% Front Matter roman numerals
   \setcounter{page}{2}             %% Start on the second page 
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define how chapter titles will be formatted 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@makechapterhead#1{%
  \vspace*{-20 \p@}%
  {\parindent \z@ \LARGE\bf\raggedright % use raggedright to avoid problems with long titles
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
         \@chapapp\space \thechapter
        \par\nobreak
      \fi
    \fi
    \interlinepenalty\@M
        {#1} \par\nobreak
    \vskip 20\p@
  }}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define how unnumbered ('starred') chapter titles will be formatted 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@makeschapterhead#1{%
  \vspace*{-20 \p@}%
  {\parindent \z@ 
    \LARGE\bf\raggedright % use raggedright to avoid problems with long titles
    \interlinepenalty\@M
     #1\par\nobreak
    \vskip 20\p@
  }}




 \renewcommand*\l@part{\@dottedtocline{0}{0em}{1.5em}}
 \renewcommand*\l@chapter{\@dottedtocline{0}{1.5em}{2.75em}}
 \renewcommand*\l@section{\@dottedtocline{1}{4em}{2.75em}}
 \renewcommand*\l@subsection{\@dottedtocline{2}{5.75em}{2.75em}}


\def\numberlinetwo#1{\advance\hangindent\@tempdima
  \hbox to\@tempdima{\hfil #1\enspace}}



\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                         {\thechapter. #1}%
                       \else
                         \addcontentsline{toc}{chapter}{#1}%
                       \fi
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Names for sections
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\contentsname{Table of Contents}
\renewcommand\listfigurename{List of Figures}
\renewcommand\listtablename{List of Tables}
\renewcommand\nomname{List of Nomenclature}
\renewcommand\bibname{Bibliography}
\renewcommand\indexname{Index}
\renewcommand\figurename{Figure}
\renewcommand\tablename{Table}
\renewcommand\chaptername{Chapter}
\renewcommand\appendixname{Appendix}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Commands for sections. 
%
% Notice that \chapter doesn't use \startsection. This is a LaTeX quirk
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                     \global\@topnum\z@
                    \@afterindenttrue
                    \secdef\@chapter\@schapter}

\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {3.5ex \@plus 1ex \@minus .2ex}%
                                   {.3ex \@plus.2ex}%
                                   {\Large\bf\raggedright
                                   }}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {3.25ex\@plus 1ex \@minus .2ex}%
                                     {.2ex \@plus .2ex}%
                                     {\large\bf
                                     \raggedright\noindent}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {3.25ex\@plus 1ex \@minus .2ex}%
                                     {.2ex \@plus .2ex}%
                                     {\bf\normalsize
                                     \raggedright\noindent}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                    {3.25ex \@plus1ex \@minus.2ex}%
                                    {-1em}%
                                    {\bf\normalsize}
}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
                                       {3.25ex \@plus1ex \@minus .2ex}%
                                       {-1em}%
                                      {\bf\normalsize}
}





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Commands for bibliography and lists of figures and tables
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\renewcommand\listoffigures{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename}%
    \addcontentsline{toc}{chapter}{\listfigurename}
      \@mkboth{\listfigurename}%
              {\listfigurename}%
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    }

\renewcommand\listoftables{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename}%
    \addcontentsline{toc}{chapter}{\listtablename}
      \@mkboth{%
          \listtablename}%
         {\listtablename}%
    \@starttoc{lot}%
    \if@restonecol\twocolumn\fi
    }

\renewenvironment{thebibliography}[1]
{\chapter*{\bibname}%
  \addcontentsline{toc}{chapter}{\bibname}
  \singlespacing
      \@mkboth{\bibname}{\bibname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
{\def\@noitemerr
  {\@latex@warning{Empty `thebibliography' environment}}%
  \endlist}

    

\renewcommand\floatpagefraction{.9}
\renewcommand\textfraction{.1} %originally .1
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}



\endinput




