% york-thesis.cls

%% This is a class (.cls) file for LaTeX2e.
%% This should be a replacement for the dissertation.sty file used with
%% LaTeX209.  Basically we want the report class with a few modifications.
%% TLC gives an example of this on page 468.
%%
%% Author:      Thomas J. Stone
%%              Institute for Physical Science and Technology
%%              The University of Maryland
%%              College Park, Maryland
%%
%%              tstone@glue.umd.edu
%%
%% Feel free to copy, modify, and distribute.
%% I am interested in any changes you make.
%% Send changes to tstone@glue.umd.edu
%%
%%
%% This file is based on the dissertation.sty file by Pablo A. Straub.
%% (Actually it is based on a modified version that contains modifications
%% by Aaron E. Naiman.)
%
% Version History
% ---------------
% v0.1  1995-01-15      Test of Class file
%                       Included (Aaron Naiman's modified version) of 
%                       dissertation.sty
% v0.2  1995-01-15      Modified slightly to conform to LaTeX2e suggested
%                       standards
% v0.3  1995-01-15      Got rid of a bunch of stuff that I don't think
%                       is needed.  I.e.,  some of the cross referencing
%                       stuff.  I think that most people either won't
%                       use this or they have their own macros.
% v1.0  1995-04-25      Set up for distrubution to others.
%
%   9/1997  changes by Stefan Kehrbaum (sk) to accomodate new guidelines 
%   implemented by the graduate school in summer 1997
%
% v1.1 2002-02-13      Modifications by Norm Gall <gall@mac.com>
%						   for York University Toronto, ON, Canada; 
%						a) name changed to york-thesis
%						b) added a TOC entry for the Table of Contents
%						c) added {final | draft} option in \documentclass command
%						d) make footnote spacing single spaced in final
%						e) changed quoting environments for single spaceing in final
%						f) various housekeeping functions
%
% v1.2 2002-02-15	   Corrected error with biliography toc line
%
%------------------------------ Notes -----------------------------------------
%
%	a) both letterpaper and 12pt options are forced. The document can't change them.
%
%------------------------- Identification -------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{york-thesis}[2002/02/13 v1.1]
%------------------------- Initial Code ---------------------------------------
%
\RequirePackage{ifthen}
%
%------------------------- Declaration of Options -----------------------------
% saving taken from dissertation.sty with modification
%
%\newif\ifsaving
%\@namedef{ds@saving}{\savingtrue}
\newboolean{saving}

\DeclareOption{draft}{\setboolean{saving}{true}}
\DeclareOption{final}{\setboolean{saving}{false}}

\PassOptionsToClass{12pt}{report}
\PassOptionsToClass{letterpaper}{report}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}

\ExecuteOptions{draft}
%------------------------- Execution of Options -------------------------------
\ProcessOptions
%------------------------- Package Loading ------------------------------------
\LoadClass{report}
%------------------------- Main Code ------------------------------------------
%
%
%     some redefinitions I need later
%
\let\oldquote\quote
\let\oldendquote\endquote
\let\oldquotation\quotation
\let\oldendquotation\endquotation
\let\oldbibliography\bibliography
\let\oldendbibliography\endbibliography
%
% masters taken from dissertation.sty with modification
%
%\newif\ifmasters
%\@namedef{ds@masters}{\masterstrue\gdef\@thesis{Thesis}}
\newboolean{masters}\setboolean{masters}{false}
%\ifthenelse{\boolean{masters}} {\newcommand{\@thesis}{Thesis}}
%                               {\newcommand{\@thesis}{Dissertation}}
\newcommand{\@thesis}{\ifthenelse{\boolean{masters}}{Thesis}{Dissertation}}
%
%
%
% 2. Margins and spacing
%
% Rules taken from York FGS Guidelines for Theses and Dissertations
%
% In general we want to over state the margins a little bit, so that
% variations due to printing/copying don't kill us....
% The style guide requires a 1.5in top margin.   We use 1.65in.
% The sytle guide requires a 1.5in left margin.  We use 1.65in.
% The style guide requries a 1.0in right and bottom margin.
%                                                We use 1.15in.
%       This is larger because we need the page number at the bottom
%       with two blank lines between the last line and the page number
%       and at least 0.5in below the page number.  Note that the
%       0.7in footskip might be a little large, but better safe than sorry....
% The style guide requires a 1.5in left margin.  We use 1.65in.
%
%
% \spacing - redefine \baselinestretch and recompute \baselineskip
%            lateral effect: set typeface to normalize roman
% from TLC after issuing the \renewcommand{\baselinestretch}{whatever}
% command, a font changing command is needed for the change to take effect.
%
\newcommand{\spacing}[1]{\renewcommand{\baselinestretch}{#1}\large\normalsize}
%
\ifthenelse{\boolean{saving}}
{       % settings for draft
		\setlength {\topmargin}{0.0in}        % top margin    1.0 inch
        \setlength {\textheight}{8.5in}       % bottom margin 1.0 inch
        \setlength {\oddsidemargin}{0.0in}    % left margin   1.0 inch
        \setlength {\textwidth}{6.5in}        % right margin  1.0 inch
        \spacing{1}                    	      % single spacing for drafts
}
{       % settings for final
		\setlength {\topmargin}{0.65in}       % top margin    1.65 inch
        \setlength {\textheight}{7.6in}       % bottom margin 1.00 inch
        \setlength {\oddsidemargin}{0.65in}   % left margin   1.65 inch
        \setlength {\textwidth}{5.7in}        % right margin  1.15 inch
        \setlength {\footskip}{0.7in}         % 2 blank lines before pg num
        \spacing{2}                 		  % double spacing for final
        \renewenvironment{quote}			  % redefine quote as single spaced
        				 {\oldquote\spacing{1}}
        				 {\oldendquote\spacing{2}}
		\renewenvironment{quotation}		  % redefine quotation as single spaced
						 {\oldquotation\spacing{1}}
						 {\oldendquotation\spacing{2}} 
}
\setlength {\footnotesep}{14pt}         	  % baseline skip for footnotes' 1st line
\setlength {\headheight}{0in}				  % no header
\setlength {\headsep}{0in}					  % no header separation
\renewenvironment{bibliography}[1]	  		  % automatically enter toc line
		   {\addcontentsline{toc}{chapter}{Bibliography}\oldbibliography {#1}}
		   {\oldendbibliography}
%
% Make footnotes single spaced
%
%			code shamelessly stolen from setspace.sty 
%				written by Geoffrey Tobin <G.Tobin@latrobe.edu.au>
%
\long\def\@footnotetext#1{%
  \insert\footins{%
    \def\baselinestretch {1}%
    \reset@font\footnotesize
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth
    \@parboxrestore
    \protected@edef\@currentlabel{%
      \csname p@footnote\endcsname\@thefnmark
    }%
    \color@begingroup
      \@makefntext{%
        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
    \color@endgroup}}
%
%
% 3. Commands to define parameters for the front matter
% 
% There are two kinds of commands that define parametters for the  front
% matter:  those  that  provide info (like \author or \abstractfile) and
% those that set flages (like \hascopyright).
% 
% The following are the definitions of the commands  that  provide  info
% (standard  LaTeX  commands  like  \author are omitted because they are
% already defined).
%
\def\department#1{\gdef\@department{#1}}
%
\def\abstractfile#1{\gdef\@abstractfile{#1}}
%
\def\masterof#1{\gdef\@masterof{#1}}
%
\def\acknowledgementsfile#1{\gdef\@acknowledgementsfile{#1}}
%
% The following are the initial values for some commands that provide info.
%
\gdef\@author{{\it Your Full Name}}
%
\gdef\@title{{\it Your Title}}
%
\gdef\@date{\number\year}
%
\gdef\@department{Department}
%
\def\@abstractfile{abstract}
%
\def\@acknowldgementsfile{acknowledgementsfile}
%
\gdef\@masterof{Arts}
%
%
% The following are all switch setting commands along with their initial
% values and corresponding \newif definitions.
%
%
%\newif\ifhascopyright
%\hascopyrighttrue
%\def\hascopyright#1{\csname hascopyright#1\endcsname}
\newboolean{hascopyright}\setboolean{hascopyright}{true}
%
%\newif\ifhasfigures
%\hasfigurestrue
%\def\hasfigures#1{\csname hasfigures#1\endcsname}
\newboolean{hasfigures}\setboolean{hasfigures}{false}

%\newif\ifhastables
%\hastablestrue
%\def\hastables#1{\csname hastables#1\endcsname}
\newboolean{hastables}\setboolean{hastables}{false}
%
%
% 4. Command \makefrontmatter
%        
% The \makefrontmatter command creates the front matter by conditionally
% invoking other commands:
%  
%       \makeabstract, \maketitlepage, \makecopyrightpage, \makepreface,
%       \makededication, \makeacknowledgements, \tableofcontents,
%       \makelistoftables, \makelistoffigures, \makecommentpage.
%
% \makefrontmatter takes care of numbering in lowercase roman, arabic or
% none.
%
\def\makefrontmatter{
 \pagestyle {empty}
 \maketitlepage
 \makecopyrightpage
 \newpage 					% skip a page for the certificate page
 \pagestyle {plain}
 \pagenumbering {roman}
 \setcounter {page}{4}
 \@ifdefined {@abstractfile}{\makeabstract}
 \@ifdefined {@acknowledgementsfile}{\makeacknowledgements}
 \addcontentsline {toc}{chapter}{Table of Contents}
 \tableofcontents\newpage
 \ifthenelse{\boolean{hastables}}{\makelistoftables}{}
 \ifthenelse{\boolean{hasfigures}}{\makelistoffigures}{}
 \pagenumbering {arabic}
 \setcounter {page}{1}
 }
%
%
% 5. Commands to create different parts of the front matter
%
%
% \maketitlepage - create the title page according to a complex format
%
\def\maketitlepage{
 \newpage
 \vspace*{.85in}
 \begin{center}
 \spacing{1}
 {\begin{tabular}[t]{c}\@title\end{tabular}}
 \\ \hugeskip 
 \hugeskip
 \hugeskip
 \hugeskip
 {\bigskip \@author}
 \end{center}
 \hugeskip \hugeskip \hugeskip \hugeskip \hugeskip \hugeskip
 {\spacing{1}
 \begin{center}
 \ifmasters A thesis \else A dissertation \fi
          submitted to the Faculty of Graduate Studies \\
          in partial fulfilment of the requirements \\
          for the degree of \\
 \hugeskip \hugeskip \hugeskip
 \ifmasters Master of \@masterof \else Doctor of Philosophy \fi \\
 \hugeskip \hugeskip % \hugeskip
 Graduate Programme in \@department \\
 York University \\
 Toronto, Ontario \\
 \@date
 \end{center}
 \newpage}}
%
% \makecopyrightpage - create a copyright page or an empty page
%
\def\makecopyrightpage{
 \newpage
 \mbox{}\par\vfill
 \ifhascopyright
  {\large
  \begin{center}
  \boldmath $\copyright$ Copyright by \\
  \@author \\
  \@date
  \end{center}}
  \vfill
 \fi
 \newpage}
%
% \makeabstract - create the abstract page(s) including title, author, etc.
%
\def\makeabstract{
 \newpage
 \addcontentsline {toc}{chapter}{Abstract}
 {\spacing{1.1}
 \begin{center}\Large ABSTRACT \end{center}
 \spacing{1.667}
 \bigskip\par\noindent}
 \@input{\@abstractfile}
 \newpage}
%
% \makeacknowledgements - create an acknowledgements page
%
\def\makeacknowledgements{
 \newpage
 \addcontentsline {toc}{chapter}{Acknowledgements}
 \begin{center}\Large ACKNOWLEDGEMENTS \end{center}
 \hugeskip\par\noindent
 \begin{quote} \@input{\@acknowledgementsfile} \end{quote}
 \newpage}
%
% \makelistoftables - create the list of tables
%
\def\makelistoftables{
 \newpage
 \addcontentsline {toc}{chapter}{List of Tables}
 \listoftables
 \newpage}
%
% \makelistoffigures  - create the list of figures
%
\def\makelistoffigures{
 \newpage
 \addcontentsline {toc}{chapter}{List of Figures}
 \listoffigures
 \newpage}
%
% \hugeskip - skip twice as much as the TeX command \bigskip
%
\def\hugeskip{\vskip 24pt plus 8pt minus 8pt}
%
% \@ifdefined - expand #2 if command #1 is not defined
%
\def\@ifdefined#1#2{\@ifundefined{#1}{}{#2}}
%
% \@makechapterhead \@makeschapterhead - create a chapter head
%
% These standard LaTeX commands are redefined here to use not-so-huge type
%
\def\@makechapterhead#1{ \vspace*{50pt} { \parindent 0pt \raggedright
 \ifnum \c@secnumdepth >\m@ne \Large\bf \@chapapp{} \thechapter \par
 \vskip 20pt \fi \Large \bf #1\par
 \nobreak \vskip 40pt } }
%
\def\@makeschapterhead#1{ \vspace*{50pt} { \parindent 0pt \raggedright
 \Large \bf #1\par
 \nobreak \vskip 40pt } }
%
% First we redefine the headings for the toc, lof, and the lot.
% for one thing we need them centered and we need table of contents
% instead of just contents....
%
\renewcommand\contentsname{\centerline{\large \rm TABLE OF CONTENTS}}
\renewcommand\listfigurename{\centerline{\large \rm LIST OF FIGURES}}
\renewcommand\listtablename{\centerline{\large \rm LIST OF TABLES}}
\renewcommand\bibname {\centerline{\large \rm BIBLIOGRAPHY}}
%
% next we modify the definitions of \tableofcontents, \listoffigures,
% and \listoftables.  We need to have \underline{Section}   \underline{Page}
% and so forth....  basically we add the contentsheader line to each 
% of the standard definitions 
%
% we take this definition of from Aaron
%
\newcommand{\contentsheader}[2]
{       \addtocontents{#1}
        {       \centerline{\underline{#2}\protect\hfill \underline{Page}}%
        }%
}
%
\renewcommand\tableofcontents
{       \if@twocolumn
                \@restonecoltrue\onecolumn
        \else
                \@restonecolfalse
        \fi
        \chapter*{\contentsname \@mkboth        {\uppercase{\contentsname}}%
                                                {\uppercase{\contentsname}}}%
        %\contentsheader{toc}{Section}%
        \@starttoc{toc}%
        \if@restonecol\twocolumn\fi
}
%
\renewcommand\listoffigures
{       \if@twocolumn
                \@restonecoltrue\onecolumn
        \else
                \@restonecolfalse
        \fi
        \chapter*{\listfigurename \@mkboth      {\uppercase{\listfigurename}}%
                                                {\uppercase{\listfigurename}}}%
        %\contentsheader{lof}{Number}%
        \@starttoc{lof}%
        \if@restonecol\twocolumn\fi
}
%
\renewcommand\listoftables
{       \if@twocolumn
                \@restonecoltrue\onecolumn
        \else
                \@restonecolfalse
        \fi
        \chapter*{\listtablename \@mkboth       {\uppercase{\listtablename}}%
                                                {\uppercase{\listtablename}}}%
        %\contentsheader{lot}{Number}%
        \@starttoc{lot}%
        \if@restonecol\twocolumn\fi
}
%
%
%% End of file `york-thesis.cls'.



