A PhD thesis LaTeX template for Cambridge University Engineering Department.
- Krishna Kumar
The MIT License (MIT)
Copyright (c) 2013 Krishna Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Conforms to the Student Registry PhD dissertation guidelines and CUED PhD guidelines
-
Adaptive Title Page: Title page adapts to title length
-
Print / On-line version: Different layout and hyper-referencing styles
-
Pre-defined and custom fonts (Times / Fourier / Latin Modern) with math support
-
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.
-
A LyX Template is now available at https://github.com/kks32/PhDThesisLyX/
The template supports PDF, DVI and PS formats. All three formats can be generated
with the provided Makefile
.
To build the PDF
version of your thesis, run:
make
This build procedure uses pdflatex
and will produce thesis.pdf
.
To produce DVI
and PS
versions of your document, you should run:
make BUILD_STRATEGY=latex
This will use the latex
command to build the document and will produce
thesis.dvi
, thesis.ps
and thesis.pdf
documents. You will need psutils installed
Clean unwanted files
To clean unwanted clutter (all LaTeX auto-generated files), run:
make clean
Note: the Makefile
itself is take from and maintained at
here.
Usage: sh ./compile-thesis.sh [OPTIONS] [filename]
[option] compile: Compiles the PhD Thesis
[option] clean: removes temporary files - no filename required
- Open command prompt and navigate to the directory with the tex file. Run:
`compile-thesis-windows.bat`.
- Alternatively, double click on
compile-thesis-windows.bat
Thesis information such as title, author, year, degree, etc., and other meta-data can be modified in thesis-info.tex
The class file, PhDThesisPSnPDF
, is based on the standard book
class
It supports the following custom options in the documentclass in thesis.tex:
(Usage \documentclass[a4paper,11pt,print]{Classes/PhDThesisPSnPDF}
)
-
a4paper
(default as per the University guidelines) ora5paper
: Paper size -
11pt
or12pt
: The University of Cambridge guidelines recommend using a minimum font size of 11pt (12pt is preferred) and 10pt for footnotes. This template also supports10pt
. -
oneside
ortwoside
(default): This is especially useful for printing double side (twoside) or single side. -
print
: Supports Print and Online Version with different page margins and hyperlink styles. Useprint
in the options to activate Print Version with appropriate margins and page layout and view styles. Leaving the options field blank will activate Online version. -
custommargin
: You can alter the margin dimension for both print and online version by using the keywordcustommargin
in the options. Then you can define the dimensions of the margin in thepreamble.tex
file:\ifsetMargin \else \RequirePackage[left=37mm,right=30mm,top=35mm,bottom=30mm]{geometry} \setFancyHdr \fi
\setFancyHdr
should be called when using custom margins for proper header/footer dimensions -
index
: Including this option builds the index, which is placed at the end of the thesis.Instructions on how to use the index can be found here.
Note: the package
makeidx
is used to create the index. -
abstract
: This option enables only the thesis title page and the abstract with title and author to be printed. -
chapter
: This option enables only the specified chapter and it's references. Useful for review and corrections.
-
A separate abstract with the title of the PhD and the candidate name has to be submitted to the Student Registry. This can be generated using
abstract
option in the document class. Ignore subsequent warnings about skipping sections (if any). -
To generate the separate abstract and the title page, make sure the following commands are in the preamble section of
thesis.tex
file:\ifdefineAbstract \includeonly{Abstract/abstract} \else \fi
-
The chapter mode allows user to only print specific chapters along with references. By default, it excludes everything else in the front matter and appendices. This can done by using
chapter
option in the document class inthesis.tex
. Ignore subsequent warnings about skipping sections (if any). -
To generate the separate abstract and the title page, make sure the following commands are in the preamble section of
thesis.tex
file:\ifdefineChapter \includeonly{Chapter3/chapter3} \else \fi
PhDThesisPSnPDF
currently supports three fonts Times
, Fourier
and Latin Modern (default)
.
-
times
: (The University of Cambridge guidelines recommend using Times). Specifying times option in the document class will usemathptpx
orTimes
font with Math Support. -
fourier
: fourier font with math support -
default (empty)
: When no font is specified,Latin Modern
is used as the default font with Math Support. -
customfont
: Any custom font can be set in preamble by usingcustomfont
option in the document class. Then the custom font can be loaded in preamble.tex in the line:\ifsetFont \else \RequirePackage{Your_Custom_Font} \fi
PhDThesisPSnPDF
currently supports two styles authoryear
and numbered (default)
. Citation style has to be set. You can also specify custombib
style and customise the bibliography.
-
authoryear
: For author-year citation eg., Krishna (2013) -
numbered
: (Default Option) For numbered and sorted citation e.g., [1,5,2] -
custombib
: Define your own bibliography style in thepreamble.tex
file.\RequirePackage[square, sort, numbers, authoryear]{natbib}
-
(Overview of Bibtex-Styles with preview)[http://nodonn.tipido.net/bibstyle.php?]
-
If you would like to use biblatex instead of natbib. Pass the option
custombib
in the documentclass. In thepreamble.tex
file, edit the custombib section. Make sure you don't load the natbib package and you can specify the layout of your references inthesis.tex
in the reference section. If you are usingbiber
as backend, runpdflatex thesis.tex >> biber thesis >> pdflatex thesis.tex >> biber thesis >> pdflatex thesis.tex
. If you are using the default natbib package, don't worry about this.
PhDThesisPSnPDF
defines 3 different page styles (header and footer). The following definition is for twoside
layout.
-
default (leave empty)
: For Page Numbers in Header (Left Even, Right Odd) and Chapter Name in Header (Right Even) and Section #. Section Name (Left Odd). Blank Footer.Header (Even) : 4 Introduction Header (Odd) : 1.2 Section Name 5 Footer : Empty
-
PageStyleI
: For Page Numbers in Header (Left Even, Right Odd) and Chapter Name next to the Page Number on Even Side (Left Even). Section Number and Section Name and Page Number in Header on Odd Side (Right Odd). Footer is empty. Layout:Header (Even) : 4 | Introduction Header (Odd) : 1.2 Section Name | 5 Footer : Empty
-
PageStyleII
: Chapter Name on Even Side (Left Even) in Header. Section Number and Section Name in Header on Odd Side (Right Odd). Page numbering in footer. Layout:Header (Even) : Introduction Header (Odd) : 1.2 Section Name Footer[centered]: 3
The visual style of chapter headings can be modified using the titlesec
package. Edit the following lines in the preamble.tex
file.
\RequirePackage{titlesec}
\newcommand{\PreContentTitleFormat}{\titleformat{\chapter}[display]{\scshape\Large}
{\Large\filleft{\chaptertitlename} \Huge\thechapter}
{1ex}{}
[\vspace{1ex}\titlerule]}
\newcommand{\ContentTitleFormat}{\titleformat{\chapter}[display]{\scshape\huge}
{\Large\filleft{\chaptertitlename} \Huge\thechapter}{1ex}
{\titlerule\vspace{1ex}\filright}
[\vspace{1ex}\titlerule]}
\newcommand{\PostContentTitleFormat}{\PreContentTitleFormat}
\PreContentTitleFormat
-
The depth for the table of contents can be set using:
\setcounter{secnumdepth}{3} \setcounter{tocdepth}{3}
A depth of [3] indicates to a level of
\subsubsection
or #.#.#.#. Default set as 2. -
To hide sections from appearing in TOC use:
\tochide\section{Section name}
in your TeX files -
Define custom caption style for figure and table caption in
preamble.tex
using:\RequirePackage[small,bf,figurename=Fig.,labelsep=space,tableposition=top]{caption}
-
Bibliography with Author-Year Citation in
preamble.tex
:\RequirePackage[round, sort, numbers, authoryear]{natbib}
-
To use nomenclature in your chapters:
\nomenclature[g-pi]{$\pi$}{ $\simeq 3.14\ldots$}
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
ora
: Roman Symbols -
G
org
: Greek Symbols -
Z
orz
: Acronyms/Abbreviations -
R
orr
: Superscripts -
S
ors
: Subscripts -
X
orx
: Other Symbols
-
-
You can change the Title of Nomenclature to Notations or Symbols in the
preamble.tex
using:\renewcommand\nomname{Symbols}
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
dentes the Greek symbolpi
.
https://www.admin.cam.ac.uk/students/studentregistry/exams/submission/phd/format.html
http://www.eng.cam.ac.uk/postgraduate/assets/library/document/p/original/planningphd.pdf
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.
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)
You can report issues at our GitHub repository.
You can also mail the developer directly or contact Tim Love, CUED
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.
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 @input{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.
-
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.
-
If you find any let me know, or even better, patch it and contribute to the development of the LaTeX Template.
-
Make example thesis a document on how to use the template and include general guidelines and good practices.
-
Biber backend support for biblatex with Makefile
Commit 4b709fed6cdfd5b3796152f9c59b619c72df491f
- Rearranged package order in preamble to support equation numbering using cref
- Removed dependencies on obsolete packages
- Restyled the URL fonts to use the same font as text
Commit a7f123bb220bf1e207b6e49e8b2978c203582e12
- Updates to abstract separate mode with no page numbers
- Declaration included in abstract mode for submission to student registry
Commit e7f34cfd71cbe1b590d615a00d99b8d05513e5ba
- Biblatex handled as a custombib option
- UTF8 and Fontencoding after font has been loaded
Commit 6e00ac94c2193882dd6f42686fc455cc66d829df
- BibLatex Support with bibtex backend
- Chapter mode for compiling only specified chapters and references
Commit 2f6918863e3c9d0a7e95bd2651ce7ef8ae38f90a
- Fixed an issue with the headers in Nomenclature section
- Removed deprecated codes, added functionality to tweak chapter headings in preamble.tex.
- Distributed under MIT license
- Acknowledgement and Cls file update
- Appendices after References
Commit 973492fe1f1805e4fef60ec54060621b3e90a3cd
- Fixed issues with DVI >> PS >> PDF and workaround, when papersize is not set for older versions of dvips (5.97 or lower).
Commit c11f98e26566af08cb9c4cacbdfddf6b28111886
- Wider text area (75% of page size), support for separate abstract for submission to the Student Registry, appendix
Commit 324d1a5609992028afb109b424573cd3a5e31849
- Update class file to support dvips driver when using dvi > PS output in hyperTeX. Removed deprecated codes from Declaration and class files
Commit 2f397eda12ef2b81314b67847e312f688095a379
- Update to margin dimensions (1:1 ratio is maintained) with a binding offset of 5mm on the print version. Replaced the hmargin ratio of 3:2 with 1:1 with a binding offset.
Commit 9cb782f26cc3573f8d3077db520ba84b5f295049
- Declaration with automatic insertion of the author and the degree date and conforming to the statments in the University guidelines
Commit 1f695d512ae5ce765398db4dc4b6381dc0351868
- Default font size is 12pt and the default paper size is A4, confirming to the University regulations in terms of font, font sizer, paper size and set them as defaults.
Commit a5f49d49a6cc39209d95f91e667fd7b359ab5227
- Update to the Makefile to remove PS files when running Makeclean
Commit e29a99406649dcce8f23b6d9df0b87eabd09fc0e
- Update to the Makefile to support PS to PDF conversion
Commit 187b9324420812326e62d963afa42e26532e82e7
- Included a Windows Batch file for LaTeX / Nomenclature compilation
- Supports \printnomencl[optional_argument]
Commit 76a733ee305ed4aae9d546492cef768512df2b13
- Supports DVI/PS
- Supports Custom Margin and FancyHdr update
Commit 73c8dd9ea82c21476d964ad5cdff1b71fe7327c8
- Author(s): Krishna Kumar
- Adaptive Title Page: Title page adapts to the length of the title
- Print / On-line version: Different layout and hyper-referncing styles
- Pre-defined and custom fonts (Times / Palatino / Latin Modern) with math support
- Pre-defined and custom bibliography style support (authoryear / numbered / custom)
- Custom page styles: 3 Different Header / Footer styles
Author(s): Krishna Kumar
-
Cambridge Computer Laboratory PhD Thesis Template https://github.com/cambridge/thesis
-
CUED Version 1.1 Template by H. Banderi
-
Alex Ridge - original idea, code concepts & testing
-
Steven Kaneti - code concepts
-
Tina Schwamb - testing and bug reports