Date: 03/07/2015

# CUED PhD thesis template

A LaTeX / XeLaTeX / LuaLaTeX PhD thesis template for Cambridge University Engineering Department.

## Author(s)

• Krishna Kumar

## Features

• Conforms to the Student Registry PhD dissertation guidelines and CUED PhD guidelines

• Supports LaTeX, XeLaTeX and LuaLaTeX

• Title page with both College and University crests.

• Print / On-line version: Different layout and hyper-referencing styles

• Pre-defined and custom fonts (Times / Fourier / Latin Modern) with math support

• Supports system fonts (XeLaTeX)

• Pre-defined and custom bibliography style support (authoryear / numbered / custom)

• Custom page styles: 3 Different Header / Footer styles

• Pre-defined and custom margin size

• A separate abstract with thesis title and author name, along with the titlepage can be generated by passing the argument abstract to the document class.

• Option to generate only specific chapters and references without the frontmatter and title page. Useful for review and corrections.

• Draft mode: Draft water mark, timestamp, version numbering and line numbering

• A LyX Template is now available at https://github.com/kks32/PhDThesisLyX/

## Building your thesis - XeLaTeX

### Using latexmk (Unix/Linux/Windows)

This template supports XeLaTeX compilation chain. To generate PDF run



The sort keys have prefix. In this case a prefix of g is used to denote Greek Symbols, followed by -pi or -sort_key. Use a - to separate sort key from the prefixes. The standard prefixes defined in this class are:

• A or a: Roman Symbols

• G or g: Greek Symbols

• Z or z: Acronyms/Abbreviations

• R or r: Superscripts

• S or s: Subscripts

• X or x: Other Symbols

• You can change the Title of Nomenclature to Notations or Symbols in the preamble.tex using:

\renewcommand\nomname{Symbols}


TexStudio's default compile option doesn't include nomenclature, to compile your document with the nomenclature, do the following:

    Options >> Configure TexStudio >> Build >> User Commands >> add user command


In add user command type makenomeclature:makenomenclature on the left pane and makeindex %.nlo -s nomencl.ist -o %.nls on the execution side. Now you can run the user defined command makenomenclature from Tools >> User >> makenomenclature.

Alternatively, you can use the compile-thesis-windows.bat file or run make on Unix / Linux / MacOS

## To-do Notes

To include custom to-do notes in your pdf document use \mynote{Hey! I have a note} anywhere in your chapters. To activate this feature, you need to uncomment the following lines in preamble.tex. To-do notes will be available only in the draft or draftclassic and not in the final thesis.

\ifsetDraft
\usepackage[colorinlistoftodos]{todonotes}
\newcommand{\mynote}[1]
{\todo[author=kks32,size=\small,inline,color=green!40]{#1}}
\else
\newcommand{\mynote}[1]{}
\newcommand{\listoftodos}{}
\fi


## General guidelines

Why is it important to follow good practices and not get killed by a Velociraptor ;)

• To restrict the length of the figure caption in List of figures use a [short-title] and {longtitle} for the caption or the section:

\caption[Caption that you want to appear in TOC]{Actual caption of the figure}
\section[short]{title}

• To exclude sections from being numbered and disable it from appearing in the Table of Contents use \section{Section_Name} or \chapter{Chapter_Name}

• To only exclude it from being listed in the Table of Contents encapsulate the section command inside the \tochide command. \tochide{\section{Section_Name}} the section will not appear in the Table of Contents, but the section will be numbered.

• When including figures in your tex file, it's a good practice to size your picture depending on the page size, instead of using absolute values. In the following example 0.75\textwidth refers to picture width being set to 75% of the text width.

\includegraphics[width=0.75\textwidth]{minion}

• Use a - to separate sort key from the prefixes, eg., g-pi denotes the Greek symbol pi.

#### Q2: Where can I find newer versions of the University of Cambridge crest/logos?

The university updates its crest every now and then. You can find up-to-date logos on this page (subject to change without notice).

Download and exchange the new logos with CUni.eps and/or CUni.pdf. I'll try to keep the crest up to date.

#### Q3: Where can I find the guidelines to submit my thesis and requirements?

Preparing to submit:

Formatting styles:

Submitting the dissertation

#### Q4: How can I count the number of words in my thesis?

You can run the following command (Linux/Unix): ps2ascii thesis.pdf | wc -w (eg., result 2713 words)

or pdftotext thesis.pdf | wc thesis.txt -w (eg., result 2690 words)

or texcount -inc *.tex (eg., result 2341 words)

#### Q5: How do I use a system font (libertine)?

To use a system font (open type) font with XeLaTeX, please select customfont option in the documentclass in thesis.tex. Add the path and font name to the custom font definition in preamble.tex

\ifsetCustomFont
\setmainfont[
Path              = ./libertine/opentype/,
Extension         = .otf,
UprightFont = LinLibertine_R,
BoldFont = LinLibertine_RZ, % Regular Semibold
ItalicFont = LinLibertine_RI,
BoldItalicFont = LinLibertine_RZI, % Regular Semibold Italic
] {libertine}
\newfontfamily\libertinesystemfont{Linux Libertine O}
\fi


Please use XeLaTeX tool chain with LaTeXmk.

#### Q6: I found a bug in the template. Where do I report bugs?

You can report issues at our GitHub repository.

You can also mail the developer directly or contact Tim Love, CUED

## Troubleshooting warnings

#### W1: I get the LaTeX Warning: You have requested document class Classes/PhDThesisPSnPDF, but the document class provides PhDThesisPSnPDF, should I be concerned?

No! Do nothing, or if you don't want any warning messages change the line near the top of the class file to \ProvidesClass{Classes/PhDthesisPSnPDF} if you're not going to install the class file in a more standard location. You can install it in a standard location like /usr/share/texmf/tex/latex/ and run texhash to reconfigure.

#### W2:I get the package Fancyhdr Warning: \fancyhead's E option without twoside option is useless on input line # or #. What should I do?

Nothing. The warning is because the twoside option is also defined in the class, although only the oneside option is currently used.

#### W3: I get the Class PhDThesisPSnPDF Warning: Unknown or non-standard option 'something'. Will see if I can load it from the book class. If you get a warning unused global option(s): something then the option is not supported! on input line #.

You are either trying to use a undefined option or a non-standard option which is in the book class but not defined in the PhD Thesis Template. If it can be used it will be loaded and you will get no further warnings. If not, the option you chose is unavailable.

#### W4: I get LaTeX Warning: Unused global option(s):[something].

You are trying to load an option that is not supported in the PhDThesisClass and the Book Class. Are you sure you are using the right option? Check your spelling!

#### W5: I get I'm skipping whatever remains of this command line # of file thesis.aux \@Jon Zah{Chapter1/chapter1.aux}

If you are generating a separate abstract for your thesis submission, ignore this warning and good luck with your submission. If you are compiling your thesis and see this warning, please remove the option abstract from the document class.

#### W6: I get blank pages between chapters

This is normal for a book class. Usually, a new chapter in a book always starts on the right hand side, which is why you see a blank page. You can remove the extra blank page by passing openany option to the documentclass. This works for double sided printing. However, if you are printing on a single side, please pass oneside option to the document class.

#### W7: My references aren't listed in the ordered in which I cite them

This is controlled by the bibliography style. Please use \bibliographystyle{unsrt} in thesis.tex instead of apalike. This applicable only for numerically sorted references.

## Known issue(s) / Bugs / Feature requests

• Hyperlinks doesn't seem to be working in Post-Script file, however works on DVI and PDF (which is produced from the PS file), possibly viewer limitation than a code bug.

• On older versions of dvips (version 5.97 or below), if your page margins do not appear properly in your PDF, when compiling through DVI >> PS >> PDF, please ensure that you have set a4paper or a5paper in the document class. If you are still having issues you can run:

ps2pdf -sPAPERSIZE=a4 thesis.ps thesis.pdf


This issue occurs only when the papersize is not specified in the document class and you are compiling DVI >> PS >> PDF using an older version (5.97 or below) of dvips.

• Open issues can be tracked at https://github.com/kks32/phd-thesis-template/issues. If you would like a new feature to be added to the template, please create an issue and label it as an enhancement.

• Please fork me on github and create a pull request, if you would like to contribute to the repo.

## ChangeLog

The history of releases can be viewed at ChangeLog

## Acknowlegments

• Alex Ridge - original idea, code concepts & testing

• Steven Kaneti - code concepts

• Tina Schwamb - testing and bug reports

• John Plaice - Bug fixes