%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%   easychithesis.cls Version 1.17 (Dmitriy Cherkashin)  November 16, 2004
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%     Instructions And Hints
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This file provides the LaTeX2e style easychithesis for formatting
% graduate thesis at the University of Chicago.  It was written by 
% Bryan Clair and Nathan Dunfield.  For an example its use see the
% file: thesisexample.tex, and the instructions below.  
% 1999-2000 revisions were made by Martin Pergler
% 2004 revisions were made by Dmitriy Cherkashin
% 
% Nathan wrote:
% Comments or problems should be sent to nathand@math.uchicago.edu,
% but I reserve the right to ignore your e-mail, especially after I
% graduate (hopefully June 1999).
% Martin writes:
% I can be reached at pergler@math.uchicago.edu probably through
% Aug 2000, less likely afterwards. I also reserve the right
% to ignore emails, though.
%
% Comments for future revisers below.
%
% Invoking this style:  Start you document with
%
%   \documentclass{easychithesis}
%
% When printing drafts, you may not want your thesis doublespaced.
% If you use instead:
% 
%   \documentclass[singlespace]{easychithesis}
%
% or
%
%   \documentclass[onehalfspace]{easychithesis}
% 
% your thesis will come out single or 3/2 spaced respectively.
% easychithesis also understands all options understood by report.  
% Also the ``double spacing'' provided by this style is not ``true''
% doublespacing as defined by setspace.sty.  Instead, it is the same
% as on the old LaTeX 2.09 thesis style ``chithesis''.  If you want 
% ``true'' double spacing, give the option truedoublespace
%
% Title Page Information Commands
%    Example Usage:
%       \title{Stones And L^2 Invariants}
%       \author{Fred D. Belitnikoff}
%       \department{Mathematics}
%       \division{Physical Sciences}  (Sciences with an s!)
%       \degree{Doctor of Philosophy}
%       \date{July 1998}    (Your grad. date, formatted like the example)
%       \maketitle
%
% \dedication : Use for a dedication, copyright, or epigraph.
%               Produces a page with no number for the text which follows
%               If you want centering, do it yourself with 
%               \begin{center} and \end{center}.
%        Usage:
%           \dedication
%           To blah.
%
% \topmatter : Things like Abstract, Acknowledgements.
%    Usage:
%       \topmatter{Title Of Matter}
%
%       Use like \chapter, once for each page of matter you want.  Don't
%       use numbered sections within these.  Use \section* instead.
%
% The abstract environment has been changed to invoke \topmatter.
%
% \mainmatter : Signals the start of the document's body.
%    Usage:
%       \mainmatter
%
%       Use once before the first numbered \chapter.
%
%  HINTS:
%
%  1.  To get appendices, you don't do anything different from a normal
%     report document.  That means, put the command \appendix before
%     you begin your first appendix, then do each appendix with a
%     \chapter command.  Note that if you have only one appendix, it is
%     customary to leave it unnumbered.  Do this with \chapter*.
%
%  2. If you are having page break problems (which are much more
%     likely in double spacing), use the \pagebreak[n] and
%     \nopagebreak[n] commands to tell LaTeX good and bad 
%     places for page breaks. n=1,2,3 for gradually more
%     emphatic suggestion to LaTeX. n=4 is almost always
%     break page or almost never break page.
%
%  3. If you are in a rush and don't have time to go through and
%     rework places which generate overfull hboxes (stuff sticking
%     out from right hand margin), but the command \sloppy
%     before your \begin{document}. LaTeX will not generate
%     overfull hboxes but will stretch spaces more, beyond its
%     usual aesthetic preferences.
%
%  KNOWN PROBLEMS
% 
%  1.  No support for multi-volume theses.
%
%  2.  Doesn't work with older versions of setspace.sty
%
%  3.  Problems with math formulas in chapter headings:
% 
%         a.  Any lowercase letters in the formula are converted to
%         uppercase, e.g. f(x) becomes F(X).   If you really need
%         lowercase math letters in your chapter titles, use the
%         option plainchapterheads (and, if you want, type your
%         chapter titles in ALL CAPS so that the appearance doesn't
%         change).  Note there is no problem 
%         for section or subsection headings in either case.
%
%         b.  Some perfectly reasonable math commands when used in
%         \chapter give the error
%          ``LATEX ERROR: \command  ALLOWED ONLY IN MATH MODE.''
%         The solution to this is to do
%        
%              \newcommand{\mymath}{problem math goes here}
%       
%         and then
%        
%              \chapter{All about \protect\mymath}
%
%         also, the options plainchapterheads 
%         or bigchapterheads will fix this too.
%
%   4. (added June 2000). Apparently the thesis office
%      does not like how appendices appear in the toc.
%      someone should fix this next year.
%      Here is a workaround for now:
%        \chapter*{Appendix \\[3pt] Hybridized roots}
%        \setcounter{chapter}{1}
%        \setcounter{theorem}{0} % if you have numbered theorem
%        \addcontentsline{toc}{chapter}{Appendix: Hybridized roots}
%      (added in November 2004) DC: Dissertation Office seems to like
%      the new format, so no workarounds needed here (at least for now).
%
%  Improvements over older versions:
%
%  Added in 1.17: Italics appear first in subsubsection headings now, as
%    Dissertation Office doesn't like italics (they actually want the
%    fonts to be the same both in chapter/section/etc headings and in TOC)
%    and subsubsection doesn't appear in TOC by default.
%    Page numbers moved to the top-right (except for 1st pages of every
%    chapter) in the topmatter as well.
%
%  Added in 1.16: graduation date is properly centered now.
%    "Chapter" and "Appendix" lines are added to the TOC, at
%    the Dissertation Office's insistence. As a result, all numbered
%    chapters and appendices should be indented in the TOC, but
%    I couldn't figure out an easy way to do it without indenting the
%    "\topmatter" entries as well. Hopefully, someone will correct
%    this in the future.
%
%  Added in 1.15: changed spacing in lists of tables and figures
%    from defaults used in report.cls
%
%  Added in 1.14: added comments, that's it.
%
%  Added in 1.13: dots in chapter toc entries
%    move up page #s where on bottom
%    put subscript sizing commands in AtBeginDocument
%    add toc entries for list of figures and tables
%
%  Added in 1.12: print footnote indicators in footnotes in normal
%    text, not superscript, and enlarge footnote text style to
%    please dissertation office (ONE RISKY THING marked %RISKY)
%
%  Added in 1.11 (start of Martin Pergler's revisions): 
%  a) extra space on top and bottom of title page to more closely
%    follow thesis office recs 
%  b) changed page breaking penalties to (more strongly) discourage
%    page breaks after 1st line/before last line of para.
%    This was happening too often with double spacing. Can omit this modification  
%    by package option oldpenalties. May still need to help LaTeX using
%    \nopagebreak[n] command.
%  c) package option bigchapterheads like plainchapterheads (no caps!) but 
%     with text one size bigger than section titles.
%  d) added code to force subsubscripts, etc. in math formulas to be
%    no smaller than 9pts, to satisfy thesis office.
%
%  Added in 1.10:  When the table of contents is over 1 page, made so
%  that the page numbers appear on the bottom.
%
%  Added in 1.8:  Increased spacing before Chapter titles.
%
%  Added in 1.7:  Added more space between footnotes.
%
%  Added in 1.6:  Spacing on title page made true
%  doublespacing to please thesis office.  This change does not affect
%  the rest of the document.
%
%  Added in 1.4: Name of the bibliography is now References, to please the
%  thesis office.  If you want to change it back, put
%
%   \renewcommand{\bibname}{Bibliography} %@MP fixed spelling   
%
%  in your TeX file prior to \begin{document}
%
% =========================================================
% Info for future class file revisers (by Martin Pergler)
% ========================================================
%
% 1. My sympathies
% 2. If you are in the math dept, easychithesis is under
%    cvs control (version tracking) with directory /zz/pub/CVS
% 3. The thesis office has offered (June 2000) to put copies
%    of the relevant files on its web page. Let them know
%    you are revising and give them your new version.
% 4. general philosophy that has worked until now:
%     try to do the least necessary and piggyback as
%     much as possible on standard LaTeX classes.
%
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesClass{easychithesis}[2004/11/16 Easy Chicago Thesis Class For
LaTeX v1.17]

\RequirePackage{setspace}[1998/04/8]

\newcommand{\etptsize}{12pt}

\DeclareOption{10pt}{\renewcommand{\etptsize}{10pt}}
\DeclareOption{11pt}{\renewcommand{\etptsize}{11pt}}
\DeclareOption{12pt}{\renewcommand{\etptsize}{12pt}}
\DeclareOption{letterpaper}{\PassOptionsToClass{letterpaper}{report}}

% The following options set the global amount of spacing

\newcommand{\etspacing}{\setstretch{1.37}}
\DeclareOption{truedoublespace}{\renewcommand{\etspacing}{\doublespacing}}
\DeclareOption{doublespace}{\renewcommand{\etspacing}{\setstretch{1.37}}}
\DeclareOption{onehalfspace}{\renewcommand{\etspacing}{\onehalfspacing}}
\DeclareOption{singlespace}{\renewcommand{\etspacing}{\singlespacing}}

% \etchapterheadstyle is used in heading in text %@MP
% \etchapterheadstyletoc is used in the table of contents
% If you insist, you can redefine these prior to \begin{document} in your thesis

\newcommand{\etchapterheadstyle}[1]{\large\bfseries\MakeUppercase{#1}}
\newcommand{\etchapterheadstyletoc}[1]{\MakeUppercase{#1}}

\DeclareOption{plainchapterheads}{
  \renewcommand{\etchapterheadstyle}[1]{\large\bfseries #1}
  \renewcommand{\etchapterheadstyletoc}[1]{#1}
}

\DeclareOption{bigchapterheads}{
  \renewcommand{\etchapterheadstyle}[1]{\Large\bfseries #1}
  \renewcommand{\etchapterheadstyletoc}[1]{#1}
}

% Higher line spacing makes the TeX page breaking algorithm work harder,
% and badness from shoving a line to next page greater.
% The standard plain TeX=LaTeX penalties for widow and club lines (=\@medpenalty-1)
% are not high enough to prevent them from happening far too often. So increase them.
% Also LaTeX actually *encourages* page breaks (penalty -\@lowpenalty) before 
% first item in a list-type environment, after the last item, and in between items. But in
% math papers many such lists are t.f.a.e. conditions in a theorem, where this is 
% highly undesirable. Unfortunately the same parameters as control pagination
% penalties before and after paragraphs apply, so we walk a fine line here. 
% Things seem to work best if we set penalty before a list /para,
% and between list items to 0 (indifferent). Keep slightly negative penalty after list/para
% by not changing it.
% Allow option oldpenalties to do none of this.

\newcommand{\etpagepenalties}{ %@MP
\widowpenalty\@highpenalty
\clubpenalty\@highpenalty
\@beginparpenalty0
\@itempenalty0
\setlength{\parskip}{0pt plus 6pt} % default is 0plus1pt, need more 
                                   % wiggle space for page break alg.
}
\DeclareOption{oldpenalties}{\renewcommand{\etpagepenalties}{}}

% Prevent overfull hboxes since these are a big thesis no-no;
% an ugly underfull hbox is much better, especially since in 
% double spacing extra horizontal blank space is less noticeable
% A better solution would be set \tolerance or maybe 
% \emergencystretch to some more optimal values, but 
% the following seems to work quite OK.

%\sloppy % user can override with \fussy %@MP
% On reflection, don't do this; tell users to use \sloppy themselves

% Pass all other options to report.cls.
\DeclareOption*{%
 \PassOptionsToClass{\CurrentOption}{report}
}

% It would be better to have the following line next, 
% rather than setting the defaults manually, by
% this would break early version of LaTeX2e
%
%\ExecuteOptions{12pt,letterpaper,doublespace}
\ProcessOptions\relax
\LoadClass[\etptsize]{report} 

% Adjust spacing of document

\etspacing
\etpagepenalties %@MP

% Adjust spacing in list of figures and tables (to accommodate XX.XX numbers)

\renewcommand*\l@figure{\@dottedtocline{1}{1.5em}{3.0em}}
\let\l@table\l@figure

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%     Commands Defined For Use By Thesis Author
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \dedication : Use for a dedication, copyright, or epigraph.
%               Produces a page with no number for the text which follows
%               If you want centering, do it yourself with 
%               \begin{center} and \end{center}.
%
\newcommand{\dedication}{
        \chapter*{}
        \thispagestyle{empty}
}

%
% \topmatter : Things like Abstract, Acknowledgements.
%    Usage:
%       \topmatter{Title Of Matter}
%
%       Use like \chapter, once for each page of matter you want.  Don't
%       use numbered sections within these.  Use \section* instead.
%
\newcommand{\topmatter}[1]{
        \chapter*{#1}
        \addcontentsline{toc}{chapter}{#1}
}

%
% redefinition of abstract environment
% 

\renewenvironment{abstract}{\topmatter{Abstract}}{}

%
% \mainmatter : Signals the start of the document's body.
%    Usage:
%       \mainmatter
%
%       Use once before the first numbered \chapter.
%
\newcommand{\mainmatter}{
        \clearpage
 % In the initial part of the document, all page numbers should be at
 % the bottom.  After \mainmatter  most of them go to the top.
 % Changing where the page numbers go on pages that aren't the first
 % page of a chapter. 
        \pagestyle{myheadings}
        \markright{}
        \pagenumbering{arabic}
 % "Chapter" line added to the TOC
        \addcontentsline{toc}{TOCextra}{Chapter}

}

% "Appendix" line added to the TOC
\let\oldappendix = \appendix
\renewcommand{\appendix}{\addcontentsline{toc}{TOCextra}{Appendix}
\oldappendix}

%
% Title Page Information Commands
%    Example Usage:
%       \title{Stones And L^2 Invariants}
%       \author{Fred D. Belitnikoff}
%       \department{Mathematics}
%       \division{Physical Sciences}  (Sciences with an s!)
%       \date{July 1998}    (Your grad. date, formatted like the example)
%       
%     
\renewcommand{\title}[1]{\gdef\@title{#1}}
\renewcommand{\author}[1]{\gdef\@author{#1}}
\newcommand{\department}[1]{\gdef\@department{#1}}
\newcommand{\division}[1]{\gdef\@division{#1}}
\newcommand{\degree}[1]{\gdef\@degree{#1}}
\renewcommand{\date}[1]{\gdef\@date{#1}}

%
% \maketitle :  Makes the U. of Chicago dissertation title page.
%
\renewcommand{\maketitle}{
   \begin{titlepage}
   \doublespacing
   \begin{center}
     \vspace*{0.0in} %for some reason this produces exactly right amount of space at top %@MP
      THE UNIVERSITY OF CHICAGO\\
      \vfill
      \MakeUppercase{\@title}\\
      \vfill
      A DISSERTATION SUBMITTED TO\\
      THE FACULTY OF THE DIVISION OF THE \MakeUppercase{\@division}\\
      IN CANDIDACY FOR THE DEGREE OF\\
      \MakeUppercase{\@degree}\\
      \ \\
      DEPARTMENT OF \MakeUppercase{\@department}\\
      \vfill
      BY\\
      \MakeUppercase{\@author}\\
      \vfill
      CHICAGO, ILLINOIS\\
      \MakeUppercase{\@date}\\
      \vspace*{0.50in} %@MP
   \end{center}
   \etspacing
   \end{titlepage}
   \pagestyle{myheadings}
   \markright{}
   \pagenumbering{roman}
   \addtocounter{page}{1}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%     Internal Formatting Commands For This Thesis Style
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Redo commands that make chapter & section headers
%
\renewcommand{\@makechapterhead}[1]{{
        \vspace*{0.3in}%
        \normalfont % also had \large\bfseries, moved to etchapterheadstyle %@MP
        \begin{center}
        \etchapterheadstyle{\@chapapp{ \thechapter}}  %  CHAPTER 1 or APPENDIX A
       
        \etchapterheadstyle{#1}                       %     TITLE OF CHAPTER
        \end{center}
}}
\renewcommand{\@makeschapterhead}[1]{{
    \vspace*{0.3in}%
        \normalfont %had \large\bfseries, see above %@MP
        \begin{center}
        \etchapterheadstyle{#1}                       %     TITLE OF CHAPTER
        \end{center}
}}
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                {-3.5ex \@plus -1ex \@minus -.2ex}%
                                {2.3ex \@plus.2ex}%
                                {\normalfont\large\bfseries\centering}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                {-3.25ex\@plus -1ex \@minus -.2ex}%
                                {1.5ex \@plus .2ex}%
                                {\normalfont\large\centering}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                {-3.25ex\@plus -1ex \@minus -.2ex}%
                                {1.5ex \@plus .2ex}%
                                {\normalfont\large\itshape}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                {3.25ex \@plus1ex \@minus.2ex}%
                                {-1em}%
                                {\normalfont\normalsize\bfseries}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
                                {3.25ex \@plus1ex \@minus .2ex}%
                                {-1em}%
                                {\normalfont\normalsize\itshape}}

% New type of TOC entry, for typesetting "Chapter" and "Appendix" lines
\newcommand*\l@TOCextra[2]{%
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}%
    \vskip 1.0em \@plus\p@
    \setlength\@tempdima{1.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode 
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak
      \hfill
      \vspace{-0.1in}
      \par
      \penalty\@highpenalty
    \endgroup
  \fi}

% Change style of printing chapters in TOC to match chapter headings.
\renewcommand*\l@chapter[2]{%
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}%
    \vskip 1.0em \@plus\p@
    \setlength\@tempdima{1.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode 
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      \etchapterheadstyletoc{#1}\nobreak 
       \leaders\hbox{$\m@th                             % these 3 lines add dots to line.
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep       % copied from latex.ltx
        mu$}\hfill                                      % should be easier way of doing this
      \hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}

% Change name of table of contents

\renewcommand{\contentsname}{Table of contents}

% Change name of bibliography

\renewcommand{\bibname}{References}

% Change the margins to fit requirements

\setlength{\oddsidemargin}{0.5in}  % really 1.5in
\setlength{\evensidemargin}{0.5in}  % really 1.5in
\setlength{\textwidth}{6in}
\setlength{\topmargin}{0in}   % really 1in 
\setlength{\headheight}{0.20in}
\setlength{\headsep}{0.20in}
\setlength{\textheight}{8.45in}
\setlength{\footskip}{0.3in} % was 0.25
\setlength{\footnotesep}{0.6cm}

% Adjust sizes of subsubscripts, etc to be no smaller than 9pts %@MP
% thesis office rule.

\AtBeginDocument{ % otherwise some packages may clobber it
\DeclareMathSizes{12}{12}{10}{9} 
\DeclareMathSizes{11}{11}{10}{9}
\DeclareMathSizes{10}{10}{9}{9}
}
% Make the table of contents, etc.,  single spaced

\let\oldtableofcontents = \tableofcontents
\renewcommand{\tableofcontents}{\begin{singlespace} \oldtableofcontents \end{singlespace}}

\let\oldlistoftables = \listoftables
\renewcommand{\listoftables}{\begin{singlespace} 
\pagebreak
\addcontentsline{toc}{chapter}{List of tables}
\oldlistoftables \end{singlespace}}

\let\oldlistoffigures = \listoffigures
\renewcommand{\listoffigures}{\begin{singlespace} 
\pagebreak
\addcontentsline{toc}{chapter}{List of figures}
\oldlistoffigures
\end{singlespace}}

% Make footnote indicators in footnotes full size not superscript
\renewcommand{\@makefntext}[1]%
  {\noindent\makebox[2.5em][r]{\@thefnmark.\ }#1}

% Increase size of footnotes and try to prevent really tiny type
% This is a kludge %RISKY
\let\scriptsize=\small
\let\tiny=\small
\let\footnotesize=\small

%  End of file
