%%% =================================================================== %%% @LaTeX-file{ %%% filename = "uwathes.dtx", %%% version = "1.0d", %%% date = "1999/07/20", %%% time = "17:03:42 EST", %%% checksum = "05688 910 3698 38022" %%% author = "Greg Gamble", %%% address = "Centre for Discrete Mathematics & Computing, %%% Department of Computer Science %%% & Electrical Engineering, %%% The University of Queensland, %%% Queensland 4072, %%% Australia", %%% telephone = "+61 7 336 52425," %%% FAX = "+61 7 336 54999, %%% copyright = "Copyright (C) 1996,1997,1998,1999 Greg Gamble, %%% all rights reserved. Copying of this file is %%% authorised only if either: %%% (1) you make absolutely no changes to your copy, %%% including name; OR %%% (2) if you do make changes, you first rename it %%% to some other name. %%% This file may be distributed under the terms of %%% the LaTeX Project Public License, as described %%% in lppl.txt in the base LaTeX distribution.", %%% email = "gregg@csee.uq.edu.au (Internet)", %%% codetable = "ISO/ASCII", %%% keywords = "latex, amslatex, ams-latex, installation", %%% supported = "yes", %%% abstract = "This is class \cls{uwathes}. It is built on the %%% standard \latex/ \cls{book} class %%% with option \opt{a4paper}. %%% It provides a document class for typesetting PhD %%% theses that complies with specifications of %%% the University of Western Australia." %%% docstring = "The checksum field above contains a CRC-16 %%% checksum as the first value, followed by the %%% equivalent of the standard UNIX wc (word %%% count) utility output of lines, words, and %%% characters. This is produced by Robert %%% Solovay's checksum utility.", %%% } %%% =================================================================== % % \iffalse %<*driver> \documentclass{amsdtx} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} \title{The \cls{uwathes} class} \author{Greg Gamble} \date{Version \fileversion, \filedate} \hDocInput{uwathes.dtx} \end{document} % % \fi % % \maketitle % \tableofcontents % \markboth{THE \cls{UWATHES} CLASS}{} % % \changes{v1.0}{96/07/23}{First release} % \changes{v1.0a}{96/07/28}{\cn{MakeUppercase} usages removed % from marks issued by \cn{@mkboth} % in \cn{listoffigures}, \cn{listoftables}, % \env{thebibliography} and \env{theindex}.} % \changes{v1.0a}{96/07/28}{Created a new environment \env{dedication} % completely analogous to % \env{acknowledgements}.} % \changes{v1.0a}{96/07/28}{List of Symbols macros analogous to those % for generating a Glossary were added.} % \changes{v1.0a}{96/07/28}{Added \cn{@mkboth} commands to issue % (heading) marks for \env{abstract} % (and hence \env{acknowledgements} and % \env{dedication}), \env{thesymbols} % and \env{theglossary}.} % \changes{v1.0a}{96/07/28}{The shorthand \cn{gloss} now emphasises % its argument in the text. % A new shorthand \cn{symb} ensures the % \cn{symbolsentry} written to the % \fn{.sym} file is in math-mode.} % \changes{v1.0a}{96/07/28}{Warning added about appropriate usage of % \cn{chapter*}.} % \changes{v1.0a}{96/07/28}{The \cn{chaptermark} and \cn{sectionmark} % changed to include chapter and section % numbers in the marks.} % \changes{v1.0a}{96/07/28}{The definitions of \cn{lhead} and \cn{rhead} % (the \pkg{fancyheadings} macros) changed % to not include chapter and section numbers % -- now these are already in the marks.} % \changes{v1.0b}{96/08/09}{Added \cn{cleardoublepage} to \env{abstract} % to ensure that \env{abstract}, % \env{acknowledgements} and \env{dedication} % environments start on a fresh righthand page.} % \changes{v1.0b}{96/08/09}{Added \cn{AtBeginSection} and \cn{numberin}. % Modified \cn{chapter} and \cn{@startsection} % to call \cn{AtBeginSection}.} % \changes{v1.0c}{98/03/29}{No change to class. Only the file header % containing phone number information altered.} % \changes{v1.0d}{99/07/20}{Updated the default setting of the % department on the titlepage. To % facilitate user modification, % \cn{dept}, \cn{institution} and % \cn{degree} are now provided. An % option \opt{honours} has also been % added (which should be regarded as % experimental).} % % % \makeatletter % \DoNotIndex{\@Alph,\@addpunct,\@addtoreset,\@afterindentfalse} % \DoNotIndex{\@afterindenttrue,\@arabic,\@author,\@biblabel} % \DoNotIndex{\@bsphack,\@chapapp,\@chapter,\@date,\@dblarg} % \DoNotIndex{\@empty,\@esphack,\@fnsymbol,\@gobbletwo,\@idxitem} % \DoNotIndex{\@ifstar,\@index,\@input,\@latex@warning,\@m} % \DoNotIndex{\@mainmatterfalse,\@mainmattertrue,\@makechapterhead} % \DoNotIndex{\@makefnmark,\@makefntext,\@makeschapterhead} % \DoNotIndex{\@maketitle,\@mkboth,\@noitemerr,\@nx,\@onlypreamble} % \DoNotIndex{\@openbib@code,\@plus,\@restonecolfalse,\@restonecoltrue} % \DoNotIndex{\@sanitize,\@schapter,\@secpenalty,\@sect,\@setthanks} % \DoNotIndex{\@ssect,\@startsection,\@starttoc,\@symbolsfile} % \DoNotIndex{\@tempskipa,\@textsuperscript,\@thanks,\@thefnmark} % \DoNotIndex{\@title,\@topnum,\@wrsymbols,\@xivpt,\@xp,\c@chapter} % \DoNotIndex{\c@enumiv,\c@footnote,\c@secnumdepth,\c@section} % \DoNotIndex{\g@addto@macro,\hb@xt@,\if@mainmatter,\if@nobreak} % \DoNotIndex{\if@noskipsec,\if@openright,\if@restonecol,\if@twocolumn} % \DoNotIndex{\m@ne,\p@,\p@enumiv,\protected@write,\skip@,\tw@,\z@,\z@skip} % \makeatother % % \section{Introduction} % The file \fn{uwathes.dtx} is the master file for the \latex/ % class, \cls{uwathes}, which provides a class for writing theses % for \latex/ users in the Department of Mathematics \& Statistics % at the University of Western Australia. It is built on the % standard \latex/ \cls{book} class with option \opt{a4paper}. % It provides a document class for typesetting % theses that complies with specifications of % the University of Western Australia. % The author wishes to thank Ivano Pinneri, whose thesis master % file provided an excellent starting point for the creation of % this document class. % % \StopEventually{ % \begin{thebibliography}{9} % \addcontentsline{toc}{section}{\numberline{}Bibliography} % \bibitem{AmSLaTeX} American Mathematical Society, % \emph{\amslatex/ Version 1.2 User's Guide} (Jan.\ 1995). % Filename: \fn{amsldoc.dvi}. % \bibitem{source2e} J.~Braams, D.~Carlisle, A.~Jeffrey, L.~Lamport, % F.~Mittelbach, C.~Rowley, and R.~Sch\"opf, % \emph{The \LaTeXe\ Sources} (Jun.\ 1996). % Filename: \fn{source2e.dvi}. % \bibitem{amsthm} M.~Downes, % \emph{The \pkg{amsthm} package} (Version 1.2a, Feb.\ 1995). % Filename: \fn{amsthm.dvi}. % \bibitem{uwamaths} G.~Gamble, % \emph{The \pkg{uwamaths} package}, % (Version 1.0g, Aug.\ 1996). % Filename: \fn{uwamaths.dvi}. % Describes a general purpose package of macros for the % Department of Mathematics \& Statistics at the % University of Western Australia. % \bibitem{Companion} M.~Goossens, F.~Mittelbach, and A.~Samarin, % \emph{The \latex/ Companion} (Addison-Wesley, 1994). % \bibitem{TeX} D.~E.~Knuth, % \emph{The \tex/book} % (Addison-Wesley, 1984). Describes \tex/ in detail. % \bibitem{LaTeX} L.~Lamport, % \emph{\latex/ -- A Document Preparation System} % (Addison-Wesley, first ed., 1985). Describes \latex/ 2.09. % \bibitem{LaTeXe} L.~Lamport, % \emph{\latex/ -- A Document Preparation System} % (Addison-Wesley, second ed., 1994). Updated for \LaTeXe. % \bibitem{clsguide} The \latex/3 Project, % \emph{\LaTeXe\ for class and package writers} (Jun.\ 1996). % Filename: \fn{clsguide.dvi}. % \end{thebibliography} % \addcontentsline{toc}{section}{\numberline{}Index} % \DisableCrossrefs % \PrintIndex % \addcontentsline{toc}{section}{\numberline{}Change History} % \PrintChanges % } % % \section{Implementation} % The usual name, date, and version information. % \begin{macrocode} \typeout{uwathes 1.0d} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{uwathes}[1999/07/20 v1.0d] % \end{macrocode} % We build the class \cls{uwathes} on top of \latex/'s % \cls{book} class with option \opt{a4paper} but we % prefer to use a little more of the page. % % As an experiment we include an \opt{honours} option. This % undoubtedly could do with some tweaking, but should be % adequate, since the restrictions on Honours Dissertations % are somewhat looser than PhD theses. % \begin{macrocode} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} \newif\if@honours \DeclareOption{honours}{\@honourstrue} \ProcessOptions\relax \LoadClass[a4paper]{book} % \end{macrocode} % The following code was taken straight from the \cls{amsbook} % class. % \begin{macrocode} \def\calclayout{\advance\textheight -\headheight \advance\textheight -\headsep % \end{macrocode} % \pagebreak % \begin{macrocode} \oddsidemargin\paperwidth \advance\oddsidemargin -\textwidth \divide\oddsidemargin\tw@ \ifdim\oddsidemargin<.5truein \oddsidemargin.5truein \fi \advance\oddsidemargin -1truein \evensidemargin\oddsidemargin \topmargin\paperheight \advance\topmargin -\textheight \advance\topmargin -\headheight \advance\topmargin -\headsep \divide\topmargin\tw@ \ifdim\topmargin<.5truein \topmargin.5truein \fi \advance\topmargin -1truein\relax } % \end{macrocode} % Now we set the page parameters. If a user wishes to reset % these, it is recommended that they do so in the following % way and in the following order. In particular, take note % of what parameters are set \emph{before} and \emph{after} % the \cn{calclayout} command. % The University of Western Australia specifies that % the margin near the binding must be at least $4\,$cm % and other margins at least $2\,$cm. % Our settings are slightly more than these. If the user % chooses the \opt{oneside} option then \cn{evensidemargin} % is ignored, and all lefthand margins are slightly more than % $4\,$cm. % \begin{macrocode} \setlength{\textheight}{\paperheight} \addtolength{\textheight}{-4.4cm} \setlength{\textwidth}{\paperwidth} \addtolength{\textwidth}{-6.4cm} \normalsize \setlength{\headheight}{2\baselineskip} \calclayout \addtolength{\evensidemargin}{-1.2cm} \addtolength{\oddsidemargin}{0.8cm} \setlength{\marginparsep}{4mm} \setlength{\marginparwidth}{12mm} % \end{macrocode} % We ensure that the \amslatex/ packages % \pkg{amsmath} \cite{AmSLaTeX}, % \pkg{amsfonts} and \pkg{amsthm} \cite{amsthm} are loaded. % The latter of these provides more developed theorem environments % than standard \latex/. % You get still more if you use % the \pkg{uwamaths} package \cite{uwamaths}. % The \env{proof} environment is redefined to give a % \textbf{bold} header (it's done in the same way as % the \pkg{uwamaths} package \cite{uwamaths}). % \begin{macrocode} \RequirePackage{amsmath}\relax \ifx\relax\mathfrak \@xp\@gobbletwo \else \let\mathfrak\relax \fi \RequirePackage{amsfonts}\relax \RequirePackage{amsthm}\relax \renewenvironment{proof}[1][\proofname]{\par \normalfont \topsep6\p@\@plus6\p@ \trivlist \item[\hskip\labelsep\bfseries #1\@addpunct{.}]\ignorespaces }{% \qed\endtrivlist }% % \end{macrocode} % The following \amslatex/ command tells \latex/ to allow breaks % within maths displays but to avoid them as much as possible. % \begin{macrocode} \allowdisplaybreaks[1] % \end{macrocode} % Now we set up commands for the titlepage. The commands % \cn{title}, \cn{author} and \cn{date} are used in the % usual way. The command \cn{thismonth} macro is essentially % \cn{today} without the day, and may be used within % \cn{date}. The \cn{author} and \cn{title} commands are % straight from the \cls{amsbook} class. % \begin{macrocode} \renewcommand{\title}[2][]{\gdef\shorttitle{#1}\gdef\@title{#2}} \edef\title{\@nx\@dblarg \@xp\@nx\csname\string\title\endcsname} \renewcommand{\author}[2][]{\gdef\shortauthors{#1}\gdef\authors{#2}} \edef\author{\@nx\@dblarg \@xp\@nx\csname\string\author\endcsname} \let\shortauthors\@empty \let\authors\@empty \def\thismonth{\ifcase\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} % \end{macrocode} % Now we provide commands \cn{dept}, \cn{institution} and % \cn{degree}. The user will probably not need to change % these from their default values. They are used just once % in the \cn{thanks} command. % \begin{macrocode} \newcommand{\dept}[1]{\gdef\department{#1}} \newcommand{\institution}[1]{\gdef\theinstitution{#1}} \newcommand{\degree}[1]{\gdef\thedegree{#1}} \renewcommand{\thanks}[1]{\let\thankses\@empty \g@addto@macro\thankses{\thanks{#1}}} \dept{Department of Mathematics \& Statistics} \institution{The University of Western Australia} \if@honours \degree{Bachelor Science with Honours} \else \degree{Doctor of Philosophy} \fi \if@honours \thanks{This dissertation is submitted in partial fulfilment\\ of the requirements for the degree of\\ \thedegree\\ at \theinstitution\\ \department} \else \thanks{This thesis is presented for the degree of\\ \thedegree\\ of \theinstitution\\ \department} \fi % \end{macrocode} % The value of \cn{thanks} is set in the % titlepage by the \cn{maketitle} command. % The \cn{maketitle} command itself, is a simplified version % of the one from the \cls{book} class. % \begin{macrocode} \renewcommand\maketitle{\par \frontmatter \begingroup \renewcommand\thefootnote{\@fnsymbol\c@footnote}% \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% \long\def\@makefntext##1{\parindent 1em\noindent \hb@xt@1.8em{% \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% \@maketitle \endgroup \setcounter{footnote}{0}% \global\let\thanks\relax \global\let\maketitle\relax \global\let\@maketitle\relax \global\let\@thanks\@empty \global\let\@author\@empty \global\let\@date\@empty \global\let\@title\@empty \global\let\title\relax \global\let\author\relax \global\let\date\relax \global\let\and\relax } \def\@maketitle{\cleardoublepage \thispagestyle{empty}% \begingroup \topskip\z@skip \null\vfil \begingroup \vspace*{2cm} \Huge\bfseries \centering \openup\medskipamount \@title\par\vspace{24pt}% \centering \mdseries\authors\par\bigskip \endgroup \vspace{6cm} \begin{center} \ifx\@empty\thankses\else\@setthanks\\\fi \ifx\@empty\@date\thismonth, \number\year\else\@date\fi \end{center} \endgroup} \def\@setthanks{\def\thanks##1{\par##1\@addpunct.}\thankses} % \end{macrocode} % We now create the \env{abstract}, % \env{acknowledgements}, \env{dedication}, % \env{theglossary} environments % and \env{thesymbols} environments. % \begin{macrocode} \newcommand{\abstractname}{Abstract} \newenvironment{abstract}{\cleardoublepage \section*{\abstractname} \@mkboth{\abstractname}{\abstractname}% \addcontentsline{toc}{chapter}{\abstractname}}{} \newenvironment{acknowledgements}% {\renewcommand{\abstractname}{Acknowledgements}% \begin{abstract}} {\end{abstract}} \newenvironment{dedication}% {\renewcommand{\abstractname}{Dedication}% \begin{abstract}} {\end{abstract}} \newcommand{\glossaryname}{Glossary} \newenvironment{theglossary}% {\chapter*{\glossaryname} \@mkboth{\glossaryname}{\glossaryname}% \addcontentsline{toc}{chapter}{\glossaryname} \thispagestyle{plain} \begin{description}} {\end{description}} \newcommand{\listsymbolsname}{List of Symbols} \newenvironment{thesymbols}% {\chapter*{\listsymbolsname} \@mkboth{\listsymbolsname}{\listsymbolsname}% \addcontentsline{toc}{chapter}{\listsymbolsname} \thispagestyle{plain} \begin{description}} {\end{description}} % \end{macrocode} % Analogous to the commands \cn{makeglossary}, \cn{glossaryentry} % and \cn{glossary} \cite{source2e}, we define % \cn{makesymbols}, \cn{symbolsentry} and \cn{symbols} % commands for generating a \textbf{List of Symbols}. % Thus a command \cn{makesymbols} in the preamble causes the % opening of a \fn{.sym} file. Then \cn{symbols} causes % \cn{symbolsentry}s to be written to the \fn{.sym} file. It is % then up to the user to create from the \fn{.sym} file % a \fn{.smb} file that contains a \env{thesymbols} environment % conceivably by creating an appropriate \fn{.ist} (indexstyle) % file and then running \makeindx/ with the appropriate options. % To cause the \fn{.smb} file to be included in a document the % user issues a \cn{printsymbols} command. See a bit later below. % \begin{macrocode} \def\makesymbols{% \newwrite\@symbolsfile \immediate\openout\@symbolsfile=\jobname.sym \def\symbols{\@bsphack\begingroup \@sanitize \@wrsymbols}\typeout {Writing symbols file \jobname.sym }% % \end{macrocode} % Opening the write channel should be done only once % since on some operating systems multiple opens are forbidden and in % any case it is useless; so we turn this into a no-op after use. % (The previous comment is taken straight from a similar one in % \cite{source2e}.) % \begin{macrocode} \let\makesymbols\@empty } \@onlypreamble\makesymbols \def\@wrsymbols#1{% \protected@write\@symbolsfile{}% {\string\symbolsentry{#1}{\thepage}}% \endgroup \@esphack} % \end{macrocode} % \begin{macrocode} \def\symbols{\@bsphack\begingroup\@sanitize\@index} % \end{macrocode} % We provide \cn{printglossary} and \cn{printsymbols} commands, % analogous to \cn{printindex}. % \begin{macrocode} \newcommand\printglossary{\@input{\jobname.gls}}% \newcommand\printsymbols{\@input{\jobname.smb}}% % \end{macrocode} % We redefine the \cn{listoftables} and \cn{listoffigures} % commands, and the \env{thebibliography} and % \env{theindex} environments % to add a contents line to the table of contents. % Since we prefer headlines not to be entirely uppercase, % uses of \cn{MakeUppercase} for (headline) marks % have also been deleted. The \latex/ \cls{book} % class doesn't issue marks when the \cn{chapter*} % macro is used -- from the code below one can see % an explicit use of \cn{@mkboth} in each of % \cn{listoffigures}, \cn{listoftables}, % \cn{thebibliography} and \cn{theindex}. This serves % as a warning to users that \cn{chapter*} is % really a low-level command and should normally % be used in the make-up of higher level commands % in the \emph{preamble} or a user's personal macros % file. % \begin{macrocode} \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} \@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\widowpenalty4000% \sfcode`\.\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% \endlist} \renewenvironment{theindex} {\if@twocolumn \@restonecolfalse \else \@restonecoltrue \fi \columnseprule \z@ \columnsep 35\p@ \twocolumn[\@makeschapterhead{\indexname}]% \addcontentsline{toc}{chapter}{\indexname} \@mkboth{\indexname}{\indexname}% \thispagestyle{plain}\parindent\z@ \parskip\z@ \@plus .3\p@\relax \let\item\@idxitem} {\if@restonecol\onecolumn\else\clearpage\fi} % \end{macrocode} % In case you want an index we have the following code (also % from the \cls{amsbook} class). % \begin{macrocode} \newcommand\seename{see also}% \newcommand\see[2]{{\em \seename\/} #1}% \newcommand\printindex{\@input{\jobname.ind}}% % \end{macrocode} % For convenience we provide \cn{indx}, \cn{gloss} and \cn{symb} % as shorthand for indexing, glossary and symbols listing commands % to deal with the most usual way we would use \cn{index}, \cn{glossary} % and \cn{symbols} e.g. % \begin{center} % \begin{tabular}{cc@{\quad abbreviates\quad}c} % \slshape\verb|\indx{gnat}| &&\slshape\verb|gnat\index{gnat}|\\ % \slshape\verb|\gloss{gnat}| &&\slshape\verb|\emph{gnat}\glossary{gnat}|\\ % \slshape\verb|\symb{=}| &&\slshape\verb|=\symbols{$=$}| % \end{tabular} % \end{center} % The abbreviation \cn{symb} assumes that the symbol is a math-mode % symbol -- don't use it, if your symbol is not a math-mode symbol. % Also, don't use \cn{symb} if its argument has arguments. % \begin{macrocode} \newcommand{\indx}[1]{#1\index{#1}} \newcommand{\gloss}[1]{\emph{#1}\glossary{#1}} \newcommand{\symb}[1]{#1\symbols{\ensuremath{#1}}} % \end{macrocode} % Now we set up sections and chapters headers in the style of the % \cls{amsbook} class. The macros are straight from the \cls{amsbook} % class except that for the chapterhead macros the setting of % \cn{topskip} was removed \dots\ since besides wasting paper % this upset the \cn{topskip} on subsequent pages. % \begin{macrocode} \newdimen\linespacing \normalsize \setlength{\linespacing}{\baselineskip} \newdimen\normalparindent \setlength{\normalparindent}{18pt} \def\@makechapterhead#1{% \begingroup \fontsize{\@xivpt}{18}\bfseries\centering \ifnum\c@secnumdepth>\m@ne \leavevmode \hskip-\leftskip \rlap{\vbox to\z@{\vss \centerline{\normalsize\mdseries \uppercase\@xp{\chaptername}\enspace\thechapter} \vskip 3pc}}\hskip\leftskip\fi #1\par \endgroup \skip@34\p@ \advance\skip@-\normalbaselineskip \vskip\skip@ } \def\@makeschapterhead#1{% \begingroup \fontsize{\@xivpt}{18}\bfseries\centering #1\par \endgroup \skip@34\p@ \advance\skip@-\normalbaselineskip \vskip\skip@ } \def\section{\@startsection{section}{1}% \z@{.7\linespacing\@plus\linespacing}{.5\linespacing}% {\normalfont\bfseries\centering}} \def\subsection{\@startsection{subsection}{2}% \normalparindent{.5\linespacing\@plus.7\linespacing}{-.5em}% {\normalfont\bfseries}} \def\subsubsection{\@startsection{subsubsection}{3}% \normalparindent\z@{-.5em}% {\normalfont\itshape}} \def\paragraph{\@startsection{paragraph}{4}% \normalparindent\z@{-\fontdimen2\font}% \normalfont} \def\subparagraph{\@startsection{subparagraph}{5}% \z@\z@{-\fontdimen2\font}% \normalfont} \def\appendix{\par \c@chapter\z@ \c@section\z@ \let\chaptername\appendixname \def\thechapter{\@Alph\c@chapter}} % \end{macrocode} % To get nice page headers we use the % \pkg{fancyheadings} package. % \begin{macrocode} \RequirePackage{fancyheadings} \addtolength{\headwidth}{5truemm} \lhead[\fancyplain{\hskip-5mm\bfseries\thepage}{\bfseries\thepage}]% {\fancyplain{}{\sffamily\slshape\rightmark}} \chead[]{} \rhead[\fancyplain{}{\sffamily\slshape\leftmark}]% {\fancyplain{\begin{picture}(0,0)% \put(0,0){\makebox[5truemm][r]{\bfseries\thepage}}% \end{picture}}{\bfseries\thepage}} \cfoot{} \pagestyle{fancyplain} \renewcommand{\chaptermark}[1]{\markboth{% \ifnum \c@secnumdepth >\m@ne \if@mainmatter \@chapapp\ \thechapter. \ % \fi \fi #1}{% \ifnum \c@secnumdepth >\m@ne \if@mainmatter \@chapapp\ \thechapter. \ % \fi \fi #1}} \renewcommand{\sectionmark}[1]{\markright{% \ifnum \c@secnumdepth >\z@ \thesection. \ % \fi #1}} % \end{macrocode} % We redefine \cn{frontmatter} and \cn{mainmatter} % so that they also change the pagestyle. The user should never need % to use \cn{frontmatter} (it is used in the \cn{maketitle} % command) but should use \cn{mainmatter} to specify the start % of the thesis text. % \begin{macrocode} \renewcommand\frontmatter{% \if@openright \cleardoublepage \else \clearpage \fi \@mainmatterfalse \pagestyle{plain} \pagenumbering{roman}} \renewcommand\mainmatter{% \if@openright \cleardoublepage \else \clearpage \fi \@mainmattertrue \pagestyle{fancyplain} \pagenumbering{arabic}} % \end{macrocode} % We make available some spacing macros. % The amounts of stretch are those specified % for $12\,$pt by the \emph{\latex/ Companion} \cite{Companion}. % Other font sizes differ from these only marginally. % See the \pkg{uwamaths} package \cite{uwamaths} % where the same macros are defined, for further discussion % of these macros. % \begin{macrocode} \newcommand{\singlespacing}{\renewcommand{\baselinestretch}{1}} \newcommand{\oneandhalfspacing}{\renewcommand{\baselinestretch}{1.24}} \newcommand{\doublespacing}{\renewcommand{\baselinestretch}{1.66}} % \end{macrocode} % Now we modify the standard \latex/ macros \cn{@startsection} and % \cn{chapter} (the latter is defined in the \cls{book} class) % by adding \verb+\AtBeginSection{#1}+ in an appropriate place. % The purpose and examples of use of \cn{AtBeginSection} are % described a little later, below. % \begin{macrocode} \def\@startsection#1#2#3#4#5#6{% \if@noskipsec \leavevmode \fi \par \@tempskipa #4\relax \@afterindenttrue \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi \if@nobreak \everypar{}\else \addpenalty\@secpenalty\addvspace\@tempskipa\fi \@ifstar{\@ssect{#3}{#4}{#5}{#6}}% {\AtBeginSection{#1}% \@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}} \renewcommand\chapter{% \if@openright\cleardoublepage\else\clearpage\fi \thispagestyle{plain}% \AtBeginSection{chapter}% \global\@topnum\z@ \@afterindentfalse \secdef\@chapter\@schapter} % \end{macrocode} % We define \cn{AtBeginSection} to be a no-op by default. % \begin{macrocode} \def\AtBeginSection#1{\relax} % \end{macrocode} % Now we define the macro that motivated the desire to have something % like \cn{AtBeginSection}. \amslatex/ defines a macro \cn{numberwithin} % which doesn't work as desired in the case where a counter is already % numbered within a sectional unit -- one can end up with duplicate chapter % numbers for a table, for example. Hence we provide a macro % \cn{numberin} which otherwise works in the manner described for % \cn{numberwithin} in \cite{AmSLaTeX}, e.g. % \begin{quote}\slshape % \verb+\numberin{table}{chapter}+ % \end{quote} % will cause \env{table}s to be numbered within \texttt{chapter}s. % To get the order of the arguments right, read the above command % this way: \emph{number} \env{table} \emph{in} \texttt{chapter}. % (You will get strange effects if you get the arguments the wrong way % round.) % \begin{macrocode} \newcommand{\numberin}[2]{% \@addtoreset{#1}{#2}% \@xp\@xp\@xp\renewcommand\@xp{\csname the#1\endcsname}{% \csname the#2\endcsname.\arabic{#1}}} % \end{macrocode} % (For those curious about what \cn{@xp} does: \cn{@xp} is an % \amslatex/ abbreviation for \tex/'s \cn{expandafter}. % The above configuration of \cn{expandafter} commands is described % in \cite[page 374]{TeX}.) % Now, we describe a use for \cn{AtBeginSection}. Suppose we want % numbering to be within the particular sectional unit a numbered % item resides, i.e.\ if it is in a \texttt{subsection} we want it % numbered subordinate to the \texttt{subsection} counter, % if it is in a \texttt{chapter} % (but not in a smaller unit) we want it numbered subordinate only to % the \texttt{chapter} counter, etc. We could issue \cn{numberin} % commands each time we enter a new \texttt{chapter}, \texttt{section}, % \texttt{subsection}, \dots . (We can't use \cn{numberwithin} to do this % \dots we would end up with longer and longer strings of duplicated % sectional numbers.) This is where \cn{AtBeginSection} comes in. % To automatically number \env{table}s, \env{figure}s and \env{equation}s % within the smallest current sectional unit, one would redefine % \cn{AtBeginSection} as follows. % \begin{quote}\slshape % \verb+\renewcommand{\AtBeginSection}[1]{\numberin{table}{#1}+\\ % \verb+ \numberin{figure}{#1}+\\ % \verb+ \numberin{equation}{#1}}+ % \end{quote} % \cn{AtBeginSection} \emph{must} be defined with one argument. When % called by the \cn{chapter} or \cn{@startsection} command % (\cn{@startsection} command is invoked by \cn{section}, % \cn{subsection}, \dots) the \verb+#1+ % in the body of the \cn{AtBeginSection} command definition is % the current sectional unit (e.g.\ \texttt{chapter}, \texttt{section}, % \texttt{subsection}, \dots). % The \pkg{uwamaths} package \cite{uwamaths} defines a number of % theorem environments and a command \cn{numberallin}. Since the theorem % environments aren't actually defined by this class, we don't provide % \cn{numberallin}. Suppose, however, that you are loading the package % \pkg{uwamaths}, then to also number the theorem environments within % the smallest current sectional unit one could instead redefine % \cn{AtBeginSection} as follows. % \begin{quote}\slshape % \verb+\renewcommand{\AtBeginSection}[1]{\numberallin{#1}}+ % \end{quote} % Presumably, there are many other uses for \cn{AtBeginSection}. % \begin{macrocode} \endinput % \end{macrocode} % \section{A sample thesis master file} % Well that's it for the code. Here is an example of a typical % master file for a thesis; let's call it % \slshape\verb+mythesis+\upshape\verb+.tex+. % First we must specify the class and fontsize: % \begin{quote}\slshape % \verb+\documentclass[12pt]{uwathes}+ % \end{quote} % (An option \opt{honours} is also available, if you wish to % use the \cls{uwathes} for an Honours Dissertation; or, if % you prefer use the \fn{uwadissert.tex} template, which % uses the standard \latex/ \cls{report} class, and is available % via the \texttt{maths.uwa.edu.au} \emph{\tex/ Local Guide}.) % % Usually, the user will load the \pkg{uwamaths} package % \cite{uwamaths} but this is not essential. Suppose that % \env{theorem}s etc., \env{table}s, % \env{figures} and \env{equation}s should be numbered within the % smallest current sectional unit then one should specify: % \begin{quote}\slshape % \verb+\usepackage[unsectioned]{uwamaths}+\\ % \verb+\renewcommand{\AtBeginSection}[1]{\numberallin{#1}+ % \end{quote} % \emph{Note} that \cn{numberallin} is provided by the \pkg{uwamaths} % package, \emph{not} the \cls{uwathes} class. If you are happy with % having all \env{theorem}s etc., \env{table}s, \env{figure}s and % \env{equation}s numbered in the form \textbf{N.m.l} then the % above two % lines should be replaced by: {\slshape\verb+\usepackage{uwamaths}+} % (i.e. without declaring the \opt{unsectioned} option or redefining % \cn{AtBeginSection}). See the discussion in the previous section for % other possibilities for \cn{AtBeginSection} and \cite{uwamaths} % for other options you might want from the \pkg{uwamaths} package. % % The University of Western Australia specifies the interline % spacing for a PhD thesis should be at least $1\frac12$-spacing % but not more than double-spacing: % \begin{quote}\slshape % \verb+\oneandhalfspacing+ % \end{quote} % If you intend having an \textbf{Index} and you are using % \makeindx/ to generate it then you need: % \begin{quote}\slshape % \verb+\makeindex+ % \end{quote} % Similarly if you want a \textbf{Glossary} and/or a % \textbf{List of Symbols} and you have appropriate % \fn{.ist} (index style) files so that you can use % \makeindx/ to % generate the \fn{.gls} and \fn{.smb} files from % the (\latex/-generated) \fn{.glo} and \fn{.sym} files, % respectively, then you need (one or both of): % \begin{quote}\slshape % \verb+\makeglossary+\\ % \verb+\makesymbols+ % \end{quote} % Now the guff that will be set in the title page; % \cn{date} is optional \dots\ it defaults to today's date. % Also, {\slshape \verb+\date{}+} (i.e.\ giving \cn{date} a blank % argument) gives just the current \emph{month} and \emph{year} % (i.e. \emph{no day}). % \begin{quote}\slshape % \verb+\title{My Thesis}+\\ % \verb+\author{A. U. Thor}+\\ % \verb+\date{September 1999}+ % \end{quote} % The user may wish to over-ride the default \cn{dept}, % \cn{institution} and \cn{degree} at this point; or % alternatively over-ride the default \cn{thanks}, which % for a PhD thesis by default sets the words % \emph{This thesis is presented for \dots} in the title page. % Now the start of the document followed by \cn{maketitle} % to actually set the title page. % \begin{quote}\slshape % \verb+\begin{document}+\\ % \verb+\maketitle+ % \end{quote} % Now the usual front matter stuff. Here we have specified % that the \env{abstract} and \env{acknowledgements} environments % are in files \fn{abstract.tex} and \fn{acknow.tex}, respectively. % There is also a \env{dedication} environment entirely analogous % to the \env{acknowledgements} environment. % The \env{theglossary} environment, if there is one, should be in % file % \slshape\verb+mythesis+\upshape\verb+.gls+ % since our thesis master file is called % \slshape\verb+mythesis+\upshape\verb+.tex+. % It may be printed via \cn{printglossary} rather than using an % \cn{include} statement. % A \env{thesymbols} environment for a \textbf{List of Symbols}, % if there is one, should be in file % \slshape\verb+mythesis+\upshape\verb+.smb+ % since our thesis master file is called % \slshape\verb+mythesis+\upshape\verb+.tex+. % As for the \textbf{Glossary}, it % may be printed via \cn{printsymbols} rather than using an % \cn{include} statement. % It's good form to put the environments \env{abstract} etc.\ % in separate files. % We discuss these front matter environments a little further in the next % section. % \begin{quote}\slshape % \verb+\include{abstract}+\\ % \verb+\tableofcontents+\\ % \verb+\listoftables+\\ % \verb+\listoffigures+\\ % \verb+\printsymbols+\\ % \verb+\printglossary+\\ % \verb+\include{acknow}+ % \end{quote} % Now comes the body of the text, initiated by \cn{mainmatter}, % which sets a fancy pagestyle and arabic numbering on a fresh % page. Again, it is recommended that each chapter is in a separate % file. The \cn{appendix} macro does not generate any text but % resets the \cn{chapter} counter to number A, B, \dots. % \begin{quote}\slshape % \verb+\mainmatter+\\ % \verb+\include{chap1}+\\ % \verb+\include{chap2}+\\ % \verb+\include{chap3}+\\ % \verb+\include{chap4}+\\ % \verb+\appendix+\\ % \verb+\include{appxA}+ % \end{quote} % Let's suppose we are using \bibtex/ and our bibliography % database file is % \slshape\verb+myrefs+\upshape\verb+.bib+ and we are % using the \env{uwa} bibliography style. Then we would have: % \begin{quote}\slshape % \verb+\bibliographystyle{uwa}+\\ % \verb+\bibliography{myrefs}+ % \end{quote} % If we intend to have an index we have: % \begin{quote}\slshape % \verb+\printindex+ % \end{quote} % Finally, we have the closing out of the document: % \begin{quote}\slshape % \verb+\end{document}+ % \end{quote} % \section{The front matter environments} % Now, we discuss what goes in the included files % \fn{abstract.tex}, \fn{acknow.tex} and % \slshape\verb+mythesis+\upshape\verb+.gls+ % (the front matter environments files specified in our % sample master file above). Firstly, in the file % \fn{abstract.tex} one should have an \env{abstract} % environment, e.g. the contents of \fn{abstract.tex} % should be something like % \begin{quote}\slshape % \verb+\begin{abstract}+\\ % \verb+ TEXT+\\ % \verb+\end{abstract}+ % \end{quote} % The file \fn{acknow.tex} should contain an \env{acknowledgements} % environment, something like % \begin{quote}\slshape % \verb+\begin{acknowledgements}+\\ % \verb+ TEXT+\\ % \verb+\end{acknowledgements}+ % \end{quote} % If you also have a \env{dedication} environment it also should be % in its own file, \cn{include}d like \fn{acknow.tex} and contain % \begin{quote}\slshape % \verb+\begin{dedication}+\\ % \verb+ TEXT+\\ % \verb+\end{dedication}+ % \end{quote} % The file % \slshape\verb+mythesis+\upshape\verb+.gls+ % should contain a \env{theglossary} environment, which is % just like the standard \latex/ \env{description} environment, % i.e.\ something like % \begin{quote}\slshape % \verb+\begin{theglossary}+\\ % \verb+ \item[LABEL] DESCRIPTION+\\ % \verb+ \item[LABEL] DESCRIPTION+\\ % \verb+ .+\\ % \verb+ .+\\ % \verb+\end{theglossary}+ % \end{quote} % (Note: you can also call the glossary \fn{glossary.tex}, but % then you would need to change the \cn{printglossary} command in % \slshape\verb+mythesis+\upshape\verb+.tex+ % to \verb+\include{glossary}+. The reason for choosing to call % the glossary % \slshape\verb+mythesis+\upshape\verb+.gls+ % is to allow for the possibility of automatic generation of the % glossary using \latex/'s \cn{glossary} command in % conjunction with the program \makeindx/.) % There is also \env{thesymbols} environment that is entirely analogous % to the \env{theglossary} environment. Its default header is % \textbf{List of Symbols}. See earlier, where the environment is defined, % for a discussion of its usage. % \CheckSum{808} % \Finale