Open-source project
kks32/phd-thesis-template avatar
kks32/phd-thesis-template

phd-thesis-template: a Cambridge engineering PhD template in LaTeX

A LaTeX / XeLaTeX / LuaLaTeX PhD thesis template for Cambridge University Engineering Department (CUED)

902 stars434 forksTeXMIT

At a glance

What is it?
The CUED PhD thesis template is a LaTeX document class, PhDThesisPSnPDF, that builds a Cambridge University Engineering Department dissertation with an adaptive title page, print and online layouts, draft watermarks and optional chapter-only output. It supports LaTeX, XeLaTeX and LuaLaTeX, and its newest tagged release is v2.4 from 2018.
Who is it for?
phd-thesis-template suits a Cambridge engineering PhD candidate who wants a dissertation that already satisfies the Student Registry and CUED guidelines rather than fighting a generic book class, and the chapter and abstract options make supervisor review much easier.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 178 days ago.
What is it written in?
Mainly TeX, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A document class built to a department's regulations

The CUED PhD thesis template is described as a LaTeX, XeLaTeX and LuaLaTeX PhD thesis template for the Cambridge University Engineering Department, authored by Krishna Kumar, with the project homepage at the Cambridge engineering text processing help pages.

The first feature listed is the one that defines the project. It conforms to the Student Registry PhD dissertation guidelines and the CUED PhD guidelines. That is a narrower claim than a general purpose thesis template makes, and it is the reason the template is worth using.

The class file is PhDThesisPSnPDF, based on the standard book class, and it is invoked with options in the documentclass in thesis.tex.

latex
\documentclass[a4paper,11pt,print]{PhDThesisPSnPDF}

The options are where the departmental requirements become concrete. a4paper is the default per the University guidelines, with a5paper as an alternative. 11pt or 12pt are supported, and the documentation notes that the University of Cambridge guidelines recommend a minimum font size of 11pt with 12pt preferred and 10pt for footnotes, and that the template also supports 10pt.

oneside or twoside, with twoside as the default, is described as especially useful for printing double side or single side, which is the kind of option that seems trivial until you realise a double sided thesis with single sided page geometry produces odd results on duplex printing.

The print option is the other consequential one. It supports Print and Online Version with different page margins and hyperlink styles, so a print option activates the print version with appropriate margins, page layout and view styles, while leaving the options field blank activates the online version. For a thesis that will be both printed by the candidate and read on a screen by examiners, that is a single option rather than a forked document.

The class options are documented individually in the readme, with the margin dimensions, the index handling with the makeidx package, and the draft modes.

Building it: three engines and a Makefile from Chris Monson

The build instructions cover three compilation chains, and the differences between them are the practical part.

For XeLaTeX through latexmk on Unix, Linux or Windows:

bash
latexmk -xelatex thesis.tex
makeindex thesis.nlo -s nomencl.ist -o thesis.nls
latexmk -xelatex -g thesis.tex

The three lines matter. The first runs the compilation, the second builds the nomenclature index from the .nlo file using a style file, and the third forces a full rerun with the -g flag so the index is picked up. Without that third pass the document ships with an empty or stale nomenclature list.

For LuaLaTeX, the substitution is done through latexmk's engine option.

bash
latexmk -pdflatex=lualatex -pdf thesis.tex

For plain LaTeX producing DVI, PS and PDF together, the classic chain is used.

bash
latexmk -dvi -ps -pdf thesis.tex

The Makefile route supports the same choices with variables. make on its own builds the PDF version using pdflatex with bibtex and produces thesis.pdf, make BIB_STRATEGY=biblatex switches the bibliography engine, make BUILD_STRATEGY=xelatex and make BUILD_STRATEGY=lualatex pick the engine, and the two can be combined, for example make BUILD_STRATEGY=lualatex BIB_STRATEGY=biblatex. The latex strategy produces thesis.dvi, thesis.ps and thesis.pdf, and needs psutils installed.

The Makefile header records its own provenance, which is worth knowing. It is Chris Monson's Free Software, version 2.2.1-alpha10, maintained at bouncingchairs.net, and the licence header carries an explicit note that using the makefile to build your documents does not place them under the GPL. The readme says the same thing, that the Makefile itself is taken from and maintained there.

The chapter-only and abstract options that make review possible

Two class options exist purely to let you compile a fragment of the thesis, and for a four year project that is the feature that matters most.

The abstract option enables only the thesis title page and the abstract with title and author to be printed. The chapter option enables only the specified chapter and its references, described as useful for review and corrections.

Put together, they change how you work with your supervisor. Rather than sending a 200 page PDF and asking for comments on pages 47 to 58, you compile the chapter, send the short document, and the pagination and cross-references stay consistent because the same class is doing the work.

There is a companion option for the index. Including the index option builds the index, placed at the end of the thesis, and the documentation points at the LaTeX Indexing instructions on Wikibooks, noting that the makeidx package is used to create it.

The margin override is the other piece of real configuration. The custommargin keyword alters the margin dimension for both print and online versions, and the dimensions are then defined in the preamble file with a geometry package call, together with a call to set the fancy header so the header and footer dimensions are correct.

latex
\ifsetCustomMargin
  \RequirePackage[left=37mm,right=30mm,top=35mm,bottom=30mm]{geometry}
  \setFancyHdr
\fi

The readme also flags a deprecation: the older ifsetMargin conditional is deprecated and should be replaced with ifsetCustomMargin. That is a small thing, but it is the kind of detail that tells you the class has been maintained by someone who reads their own documentation.

Draft mode, supervisor fields and the fonts you can choose

The draft options are for the four years before submission, and there are three of them.

The default draft mode supports special features such as line numbers, images and a watermark with timestamp and custom text, and the position of the text can be modified in the preamble file. draftclassic is similar to the default draft mode in the book class, except images are not loaded. lineno enables pagewise line numbering on the outer edge, which is the mode supervisors ask for when they want to reference a specific line rather than a page.

The typography choices are broader than a template needs to be. There are pre-defined and custom fonts, Times, Fourier and Latin Modern, with math support, and system fonts are supported under XeLaTeX, which matters when you need a font the department has or a font with particular maths coverage.

Bibliography style is handled the same way, with pre-defined and custom styles covering authoryear, numbered and custom. Custom page styles give three different header and footer styles, and margins are pre-defined or custom.

One feature is worth calling out because it is not obvious from the name. You can add a supervisor or advisor to your PhD thesis or MPhil report, which matters because a PhD thesis at Cambridge has to name the supervisor and it is tedious to add that to a template that does not have a slot for it.

The title page is adaptive, adapting to title length, and carries both College and University crests. An adaptive title page sounds like a small thing until you have a title that runs to three lines and then discover the author block has been pushed off the bottom of the page.

The thesis metadata itself is kept in a separate file, thesis-info.tex, where title, author, year, degree and other metadata are modified.

The repository is a complete example, not a package

The top level layout shows what kind of thing this is, and it is worth being explicit about it because the topic list includes latex-template and people arrive expecting something they can install.

There are chapter directories Chapter1/, Chapter2/ and Chapter3/, an Abstract/ directory, an Acknowledgement/, a Declaration/, a Dedication/, two Appendix directories, a References/ directory, and a Preamble/ directory. There are Figs/ for figures and sty/ for style files, plus hooks/ for the package hooks.

At the top there is thesis.tex, the main file, thesis-info.tex for the metadata, Variables.ini, glyphtounicode.tex, and the class file PhDThesisPSnPDF.cls itself. The Makefile, compile-thesis.sh and compile-thesis-windows.bat are the build entry points, and the shell script takes a filename argument with a compile option and a clean option.

Two artefacts are checked in that are unusual to see in a repository. There is a thesis.pdf and a thesis.ps at the root, which means the compiled output travels with the source. That is convenient for a template, since you can look at the result without compiling, and it means the repository doubles as the example document.

The Makefile header names the contributors of the build system over time, Chris Monson, Andrew McNabb, Krishna Kumar and Holger Nahrstaedt, which dates the lineage of the build tooling well before the template itself.

The readme mentions a companion project for LyX users, a separate PhDThesisLyX repository, which is the same template approached through a different editor. That is a reasonable thing to exist, since LyX users cannot use a class file the way they would use a document style, but it is a separate codebase with its own maintenance.

Where this template is the wrong choice

Three limits, and the last one is the serious one.

The first is institutional. The margins, the paper size, the font size rules and the title page all encode Cambridge University Engineering Department and Student Registry requirements. A candidate at another university gets a well built document class with the wrong rules, and would have to reverse engineer and replace the layout settings to meet their own regulations. The Cambridge documentation pages linked from the project homepage are the authoritative reference for what it satisfies, and the readme states the guideline it follows.

The second is the age of the tooling. The newest tagged release is v2.4 from 2018-04-12, before it v2.3.2 from 2018-04-03 and v2.3.1 from 2017-04-23, while the last push was on 2026-04-28. The licence field says MIT and the readme badge says version 2.2, which does not match the v2.4 tag, so the badge is stale.

The risk of an old LaTeX class is not that the code is wrong, it is that the packages it loads have moved on. A class from 2018 will typically request font packages, geometry settings and package options that a current TeX distribution has changed or removed. Whether it still compiles cleanly on a 2026 TeX Live is exactly the thing to check, and the readme does not say.

The third is the middle ground nobody wants to be in. The template is well suited to a Cambridge engineering PhD candidate who wants the department's format handled for them. It is not suited to someone outside Cambridge. And for someone inside Cambridge who also wants a modern, minimal, self-maintained thesis setup, a current book class with a few lines of preamble is often less work than adapting a 2018 class.

The alternatives differ in kind. A generic thesis template from a LaTeX distribution gives you structure without institutional rules, and you fill in the requirements yourself. A journal's own class, when you are submitting an article, does the same job for a different document. And building the preamble from scratch, which takes an afternoon the first time and is then reusable for every thesis, gives exactly the layout you want with no third party constraints.

For the specific case of a Cambridge engineering PhD, though, this template removes a real category of work: you are not checking the Student Registry guidelines against your own margin settings, because someone already did it.

Editorial conclusion

phd-thesis-template suits a Cambridge engineering PhD candidate who wants a dissertation that already satisfies the Student Registry and CUED guidelines rather than fighting a generic book class, and the chapter and abstract options make supervisor review much easier. It does not suit a candidate at another institution, since the layout and margins encode Cambridge requirements, and it does not suit anyone who needs current LaTeX tooling, because the tagged releases stop at v2.4 from 2018. Before adopting it, check the class options against your own department's regulations, and confirm your TeX distribution still supports the packages the class loads.

Frequently asked questions

What is the CUED phd-thesis-template?

It is a LaTeX, XeLaTeX and LuaLaTeX PhD thesis template for the Cambridge University Engineering Department, authored by Krishna Kumar. It conforms to the Student Registry PhD dissertation guidelines and the CUED PhD guidelines, and its document class is PhDThesisPSnPDF, based on the standard book class.

How do I build the thesis with XeLaTeX?

Run latexmk -xelatex thesis.tex, then makeindex thesis.nlo -s nomencl.ist -o thesis.nls to build the nomenclature index, then latexmk -xelatex -g thesis.tex to force a full rerun so the index is picked up. The Makefile also supports make BUILD_STRATEGY=xelatex.

Can the template compile only part of the thesis for review?

Yes. The chapter option enables only the specified chapter and its references, and the abstract option enables only the thesis title page and the abstract. The readme describes both as useful for review and corrections.

How do I change the margins and bibliography style?

Add the custommargin keyword to the documentclass options and define the dimensions in the preamble file with a geometry package call, along with a call to setFancyHdr for correct header and footer dimensions. The deprecated ifsetMargin conditional should be replaced with ifsetCustomMargin. Bibliography styles are pre-defined or custom, covering authoryear, numbered and custom.

What licence does the CUED phd-thesis-template use and how current is it?

MIT, with a license.md file at the repository root, though the Makefile it ships is separately maintained as Chris Monson's Free Software under the GPL with a note that using it does not place your documents under the GPL. The newest tagged release is v2.4 from 2018-04-12 and the last push was on 2026-04-28.

Official sources

  1. kks32/phd-thesis-template on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/kks32-phd-thesis-template.svg)](https://hysenlabs.com/projects/kks32-phd-thesis-template)

Was this useful?