%rep% bithesis Class for LaTeX2e.

%% This style can usefully be used in conjunction with the doublespace
%% style which introduces a single spaced environment.
%%

\ProvidesClass{thesis_good}[1994/09/20 BU CS Thesis Class - Hacked by DBC and RM]

\DeclareOption{PhD}{\def\degreetitle{DOCTOR OF PHILOSOPHY}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{reporteld}}

\ExecuteOptions{PhD}

\ProcessOptions

\LoadClass[a4paper,11pt]{reporteld}


%% We need >15mm  margins except on the binding edge, where it is >40mm
%\oddsidemargin 14.6truemm \evensidemargin 0truemm
%\marginparwidth 40pt \marginparsep 10pt
%\topmargin 0truemm \headsep 10truemm
%\textheight 224truemm \textwidth 145truemm

\oddsidemargin 3.5truemm 
\evensidemargin -5.0truemm
\topmargin -5.0truemm 
\headsep 10truemm
\textheight 232truemm 
\textwidth 160truemm
%\headheight 0truemm

%% Disallow page breaks at hyphens (this will give some underfull vbox's,
%% so an alternative is to use \brokenpenalty=100 and manually search
%% for and fix such page breaks)
\brokenpenalty=10000

%% Use 1.6 times the normal baseline-to-baseline skip (approx double space)
\renewcommand{\baselinestretch}{1.6}

%% Redefine the macro used for floats (including figures and tables)
%% so that single spacing is used.
%% (Note \def\figure{\@float{figure}set single spacing} doesn't work
%%  because figure has an optional argument)
\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
   \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
      \@parmoderr\@floatpenalty\z@
    \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
       \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
       \@tfor \@tempa :=#2\do
                        {\if\@tempa h\advance\@tempcnta \@ne\fi
                         \if\@tempa t\advance\@tempcnta \tw@\fi
                         \if\@tempa b\advance\@tempcnta 4\relax\fi
                         \if\@tempa p\advance\@tempcnta 8\relax\fi
         }\global\count\@currbox\@tempcnta}\@fltovf\fi
    \global\setbox\@currbox\vbox\bgroup 
    \def\baselinestretch{1}\@normalsize
    \boxmaxdepth\z@
    \hsize\columnwidth \@parboxrestore}

%% Redefine the macro used for footnotes to use single spacing
\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
    \interlinepenalty\interfootnotelinepenalty 
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
   \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
    {\rule{\z@}{\footnotesep}\ignorespaces
      #1\strut}}}

%% \author, \title are defined in report; here are the rest of the
%% front matter defining macros
%% Note: If you really want, you can define your own macro for, say
%% \supervisor , just by copying the definitions of \principaladvisor
%%
\def\dept#1{\gdef\@dept{#1}}
\def\principaladviser#1{\gdef\@principaladviser{#1}}
\def\advis@r{Advisor} % default spelling---we are English!
%% Obviously, we could add a \supervisor macro
\def\principaladvisor#1{\gdef\@principaladviser{#1}\gdef\advis@r{Advisor}}
\def\firstreader#1{\gdef\@firstreader{#1}}
\def\secondreader#1{\gdef\@secondreader{#1}}
\def\submitdate#1{\gdef\@submitdate{#1}}
\def\copyrightyear#1{\gdef\@copyrightyear{#1}} % \author, \title in report
\def\@title{}\def\@author{}\def\@dept{Physics \& Space Research}
\def\@principaladviser{}\def\@firstreader{}\def\@secondreader{}
\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}
%% Stanford says that December theses should have the next year as the
%% copyright year
\ifnum\month=12
    \@tempcnta=\year \advance\@tempcnta by 1
    \edef\@copyrightyear{\number\the\@tempcnta}
\else
    \def\@copyrightyear{\number\the\year}
\fi
\newif\ifcopyright \newif\iffigurespage \newif\iftablespage \newif\ifsigpage
\copyrighttrue \figurespagetrue \tablespagetrue \sigpagefalse

%% If you're doing an MSc, I'm sure you can guess which parts to change
%% below; if not then you shouldn't be doing one.
\def\titlep{%
        \thispagestyle{empty}%
        \null\vskip3cm%
        \begin{center}
                \Large\bf\expandafter{\@title}
        \end{center}
        \begin{center}
                \rm \bf by\\
                \vspace*{0.5cm}
                \@author\\
        \end{center}
        \vfill
        
        \vfill
        \begin{center}
          \begin{tabbing}
          xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\=  \kill
          \>  \bf Astrophysics and Space Research Group\\
          \>  \bf School of Physics and Astronomy\\
          \>  \bf The University of Birmingham \\
          \>  \bf \@submitdate \\
          \end{tabbing}
        \end{center}\vskip.5in\newpage}

\def\dedicatepage{%
%\prefacesection{}
  \thispagestyle{empty}%
  \begin{center}
    \vspace*{50mm}
     To M\'{a}ire and Peter Osmond,\\
     for their years of support.
   \vfill
  \end{center}}

\def\quotepage{%
%\prefacesection{}
  \thispagestyle{empty}%
  \begin{center}
    \vspace*{50mm}
%    ``The answer, my friend, is blowin' in the wind''\\
%    \it Blowin' in the Wind, Bob Dylan
    ``And then I looked at the stars, and considered how awful it would be
    for a man to turn his face up to them as he froze to death, and see no
    help or pity in all the glittering multitude."\\
    \rightline{\it Great Expectations, Charles Dickens.}
  \vfill
  \end{center}}

\def\ackpage{%
%\prefacesection{Acknowledgements}
 \thispagestyle{empty}%
%  \parindent=0pt
\vspace*{28mm}
\noindent \large{\bf Acknowledgements}\\
\normalsize

\noindent
\input{acknowledge.tex}
%  \par
}

\def\beforeabstract{
        
        \pagestyle{empty}
        \titlep}

\def\afterabstract{
        \newpage
        \dedicatepage
        \newpage
        \quotepage
        \newpage
        \ackpage
        \newpage
%        \pagenumbering{roman}
        \pagestyle{headings}
%        \setcounter{page}{1}
        \tableofcontents
        \newpage
        \iffigurespage
                \addvspace{10pt}
                \listoffigures
                \newpage
        \fi
        \iftablespage
                \addvspace{10pt}
                \listoftables
                \newpage
        \fi
        \setcounter{page}{0}
        \pagenumbering{arabic}}
%% The declaration page above is the standard
%% declaration, but if you want the other sort ( where you admit
%% that parts of your thesis have been used elsewhere) then you'll
%% have to hack it yourself -- just replace the text by what you'd like
%%
\def\prefacesection#1{%
        \chapter*{#1}
        \addcontentsline{toc}{chapter}{#1}}

%% The \addvspace business below is to avoid the extra space that gets put
%% in the tables of figures and tables between chapters (it makes no sense
%% now that the numbering is continuous)
\def\afterpreface{\newpage
        \pagestyle{headings}}

\pagestyle{headings}
%\pagestyle{empty}

%% This produces the chapter title at the top of each page. It can be 
%% changed in the obvious way, e.g., \pagestyle{empty} or \pagestyle{plain}
%%

%%% DPC 15/9/93 Make the bibliography generate an entry in the table
%%% of contents.  

\def\thebibliography#1{\section*{\bibname\@mkboth
  {\uppercase{\bibname}}{\uppercase{\bibname}}}%
  \addcontentsline{toc}{section}{\bibname}%
  \list
  {\@biblabel{\arabic{enumiv}}}{\settowidth\labelwidth{\@biblabel{#1}}%
    \leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \usecounter{enumiv}%
    \let\p@enumiv\@empty
    \def\theenumiv{\arabic{enumiv}}}%
    \def\newblock{\hskip .11em plus.33em minus.07em}%
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=\@m}

\def\endthebibliography{%
  \def\@noitemerr{\@warning{Empty `thebibliography' environment}}%
  \endlist}

