Some notes on typesetting a maths thesis at ANU

The PhD writing experience for me went pretty smoothly and easily. But there were a few things in there that I thought was worthwhile documenting. To look at exactly what I did, I've included my toplevel LaTeX file for the thesis as thesis.tex. But I've included a few points down below to explain some of the obstacles I hit along the way and the way I resolved them.

Suggestions for breaking up the document.

I think it's a wise thing to actually break up the chapters into different directories. For instance, my preliminaries are contained in a directory called "prelim." Then, I issue an \input directive as follows.

\input{prelim/prelim}

In my case, the file prelim/prelim.tex itself contained input directives of the form:

\input{prelim/mm}

This allowed me to very easily handle the entire document in a modular way, rather than making it difficult to manage single tex file.

NOTE: even though prelim.tex is sitting inside the prelim directory, I still needed the directory included in there when issuing \input. I suspect this is because \input runs as a macro and it is evaluated at the top level, rather than locally.

Equations/headings running beyond margins

LaTeX tries best to avoid introducing too much whitespace or splitting equations (in environments like align) whenever it can be prevented. A result of this is that either you get equations or headings running into the margins.

This issue is solved by telling LaTeX to be "sloppy" in the way it deals with whitespace. Simply include

\sloppy

in the preamble of the document. It is also advisable to split up commas as separate maths delimiters. I.e., instead of

$\spt X,\ \spt Y$,

write

$\spt X$, $\spt Y$.

In the former case, the entire block $..$ would get pulled to the next line if it were to run into the margin, whereas, in the second situation, the line split would occur at the comma.

Huge gaps in the pages

Another formatting issue that often happens is the introduction of very large white space throught the document. This happens because like to prevent the breakup of equations in environments like align whenever it can - at the cost of introducing vertical whitespace.

One way to fix it is to include in the preamble:

\raggedbottom

which essentially says: keep the current behaviour of not breaking up equations, but don't stretch equations.

I found this to be a suboptimal solution, because instead of the whitespace being spread throughout the document, it becomes accumulated at the bottom, which is a waste of paper and not very aesthetic. Thus, the better solution was to tell LaTeX to breakup equations. This was done by:

\allowdisplaybreaks[4]

I found that 4 was the right level of break, but you can, of course, experiment with this. NOTE: Make sure you read over your document after doing this because it may have mucked up the legibility of your equations.

Getting the eprint number field to appear for ArXiV citations

I personally prefer to use the amsplain style for bibliography, particularly because I just rip the BibTeX entry from MathSciNet. Similarly, you can do this for ArXiV preprints too, from the ADS database (lined via ArXiV).

Obtaining the MathSciNet reference in this way has the advantage that the MR number is displayed in the citation, which makes it very easy to track down the paper, especially upon reading electronic copies. ArXiV has a simlar Eprint number, specified by a field eprint in the BibTeX entry. Unfortunately, the amsplain class doesn't know what to do with this.

In the file aaplain.bst, I've hacked the amsplain BibTeX style file to use the eprint field, so that the eprint number preceded by EP is printed in the citation. This file needs to simply be copied to the top level directory of your thesis, and then it can be used by specifying:

\bibliography{aaplain}

Margins and the geometry package

ANU has a policy that the margins should at minimum be 2cm, and for odd pages 4cm on the left and even pages 4cm on the right.

This can be achieved by using the geometry package by including the following in the preamble:

\usepackage[a4paper, twoside, margin=20mm, marginsep=20mm]{geometry}
\geometry{top=20mm, bottom=20mm, inner=20mm, outer=40mm},

The only drawback here is that this geometry becomes forced on the titlepage as well. To get around this, you should omit the \geometry directive, and instead, use: \newgeometry{top=20mm, bottom=20mm, inner=20mm, outer=40mm}

*after* your titlepage, inside the actual document. NOTE: You cannot use \geometry inside the document, it needs to be used in the preamble.

You may find that this spits out an error, and that the geometry package shipped with your system is missing the \newgeometry command. It seems that many texlive distributions (at the time of writing) are missing the version 5 of the geometry package, so you need to include geometry.sty. If this doesn't work, see CTAN Geometry package.

I also suggest that you use around 26mm for top and bottom margins, because the 20mm looks a bit artificially compressed. The 26mm is closer to the latex default.

Also, you can actually look at the "frame" of your geometry by issuing:

\geometry{showframe}

in the preamble of the document.

Page numbering, and un-numbered chapter headings

I was adamant that page number 1 should correspond to the first page of the Introduction, and I wanted all the preceding pages to not have a page number. Also, I want sections like Introduction, Acknowledgements, Abstract, etc. to not have a chapter number.

Here is a snippet from the top part of one of these Chapters:

\thispagestyle{empty}
\chapter*{Abstract}
\thispagestyle{empty}

The directives, \thispagestyle{empty} does the clearing of the page numbers from the current page. The * in \chapter* omits including this chapter in the table of contents, and prevents allocating it a chapter number.

For the table of contents, the following is what worked for me:

\thispagestyle{empty}
\tableofcontents
\addtocontents{toc}{\protect\thispagestyle{empty}}

The first \thispagestyle{empty} only seemed to clear the page number on page 2, and the weird \addtocontents... invocation seemed to do it for page 1.

Preventing the printing of the 0 chapter number in the header

I didn't want my first chapter of the thesis to be "Introduction," so naturally, I did

\chapter*{Introduction}

But I wanted the Chapter name, "Introduction" run on the header. This was done by issuing:

\chaptermark{INTRODUCTION}

However, after doing this, I found that it actually ran "0. INTRODUCTION" in the header. This was fixed by the following snippet of code I ripped off somewhere on the internet:

\renewcommand{\chaptermark}[1]{%
\ifnum\value{chapter}>0
\markboth{\thechapter{}. #1}{}%
\else
\markboth{#1}{}%
\fi}

which only enables the printing of the Chapter number for chapters larger than 0.

PDF, citation, referencing bookmarks

By using the hyperref package, PDF bookmarks and linking to citations, etc. are automatically enabled. I encourage this strongly, because this produces an electronic document which is easier to navigate.

The reference links are default a box drawn aroudn the link. This can be made to look much better by using the following in the premable:

\hypersetup{colorlinks}

Apart from that, another little trick is how to enable the chapters which have no chapter numbers to be included in the PDF navigation bar. This is achived via the \pdfbookmark command. For the Abstract page example we gave in the last section, we include the following up the top of this section:

\pdfbookmark{Abstract}{Chap:Abs}

I have no idea what the {Chap:Abs} does, but I used a different name for each bookmark.

NOTE: Even though you don't have page numbers showing up on these pages, it's very clumsy to have arabic numeral numbers appearing on the PDF navigation bar. For that reason, before the titlepage, I would issue:

\pagenumbering{roman}

and then before the start of the introduction, switch to arabic:

\pagenumering{arabic}

Also, make sure that you issue:

\setcounter{page}{1}

just prior to the Introduction.

Wrong page number displayed for bibliography, index, and nomenclature

While the table of contents got all the page numbers right, I noticed that the bibliography, index and nomenclature links on the PDF index pane were all a few pages off.

It seems that the \phantomsection command after a \cleardoublepage is the way to go to fix this. For instance, this is how my index pages were produced:

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\printindex

Long section title woes

Having long section titles can wreak havoc in the header. One way to fix it is to specify:

\sectionmark{Short Section}

Unfortunately, if the start of this long section falls on an odd page, then the \sectionmark directive is ignored and the long section name is used instead.

The solution is to omit the \sectionmark directive altogether and instead define:

\section[Short Section]{Long Section Name Goes In Here}

THe only problem with this is that "Short Section" is now used in the table of contents rather than "Long Section Name Goes In Here." This is fixed by including the following in the premable:

\usepackage[toctitles]{titlesec}