This templte is adapted from CUED Latex template of University of Cambridge
*cover_bind.doc word document to edit cover design of your final thesis book.
-
Supports LaTeX, XeLaTeX and LuaLaTeX
-
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
-
Supports system fonts (XeLaTeX)
-
Pre-defined and custom bibliography style support (authoryear / numbered / custom)
-
Custom page styles: 3 Different Header / Footer styles
-
Many useful latex packages are integrated (see
Preamble), specifically helpful while 1) thesis review (see lines 34-38Preamble.tex), 2) to provide 'epigraph' at the beginning of each chapter, 3) 'to-do notes' etc.. -
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
abstractto 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
-
Add supervisor and/or advisor to your PhD thesis.
-
Format your cover page by editing
coverpage.tex
This template supports XeLaTeX compilation chain. To generate PDF run
latexmk -xelatex thesis.tex
makeindex thesis.nlo -s nomencl.ist -o thesis.nls
latexmk -xelatex -g thesis.tex
This template supports XeLaTeX compilation chain. To generate PDF run
latexmk -pdflatex=lualatex -pdf thesis.tex
This template supports latexmk. To generate DVI, PS and PDF run
latexmk -dvi -ps -pdf thesis.tex
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 -
11ptor12pt: The University of Cambridge guidelines recommend using a minimum font size of 11pt (12pt is preferred) and 10pt for footnotes. This template also supports10pt. -
onesideortwoside(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. Useprintin 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 keywordcustommarginin the options. Then you can define the dimensions of the margin in thepreamble.texfile:\ifsetCustomMargin \RequirePackage[left=37mm,right=30mm,top=35mm,bottom=30mm]{geometry} \setFancyHdr \fi\setFancyHdrshould be called when using custom margins for proper header/footer dimensions\ifsetMarginis deprecated, please use\ifsetCustomMargininstead. -
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
makeidxis 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. -
draft: The default draft mode supports some special features such as line numbers, images, and water mark with timestamp and custom text. Position of the text can be modified inpreamble.tex. -
draftclassic: This mode is similar to the default draft mode in the book class. Images are not loaded. -
lineno: Enables pagewise line numbering on the outer edge. You can switch-off line numbering by specifyingnolinenoin the options. -
flushleft: The University recommends using ragged right or flush left alignment for texts. The reason behind this is left justifying a text may exclude a certain readers. Dyslexic people find it hard to read justified text. You can enableraggedrightoption in the document class by passingflushleftargument. Default is flush left and right.
The front page (title page) resizes to fit your title length. You can modify coverpage and some options on thesis-info.tex.
-
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
abstractoption 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.texfile:\ifdefineAbstract \includeonly{Abstract/abstract} \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
chapteroption 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.texfile:\ifdefineChapter \includeonly{Chapter3/chapter3} \fi
draft adds a watermark draft text with timestamp and version number at the top or
the bottom of the page. Pagewise line numbering is added on every page. draft settings can be tweaked in the preamble.tex.
-
Use
draftclassicin the document class options to use the default book class draft mode. -
To add figures in draft mode (default enabled), in the preamble set
\setkeys{Gin}{draft=false}.draft=truedisables figures -
To change the watermark text \SetDraftText{DRAFT}
-
To change the position of the watermark text. Default watermark position is top. The location can be changed to (top / bottom) \SetDraftWMPosition{bottom}
-
To change the draft version. Default draft version is v1.0. \SetDraftVersion{v1.1}
-
Watermark grayscale value can be modified. Text grayscale value (should be between 0-black and 1-white). Default value is 0.75 \SetDraftGrayScale{0.8}
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 usemathptpxorTimesfont with Math Support. -
fourier: fourier font with math support -
default (empty): When no font is specified,Latin Modernis used as the default font with Math Support. -
customfont: Any custom font can be set in preamble by usingcustomfontoption in the document class. Then the custom font can be loaded in preamble.tex in the line:\ifsetCustomFont \RequirePackage{Your_Custom_Font} \fi
This option uses changes package, and I find it very useful. It has a key=value system so most of the things are customizable. You can define different authors and the changes are tracked depending on the id. Please see user manual for more details. (see lines 34-38 Preamble.tex)
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.texfile.\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
custombibin the documentclass. In thepreamble.texfile, edit the custombib section. Make sure you don't load the natbib package and you can specify the layout of your references inthesis.texin the reference section. If you are usingbiberas 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. To choose a page style, include it in the documentclass options: \documentclass[PageStyleI]{Classes/PhDThesisPSnPDF}. Alternatively, page style can be changed by adding \pagestyle{PageStyleI} or \pagestyle{PageStyleII} in thesis.tex. Note: Using \pagestyle command will override documentclass options when used globally.
-
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
\subsubsectionor #.#.#.#. 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.texusing:\RequirePackage[small,bf,figurename=Fig.,labelsep=space,tableposition=top]{caption} -
Uncomment the following lines in
preamble.texto force a figure to be displayed in a particular location. UseHwhen including graphics. NoteHinstead ofh.\usepackage{float} \restylefloat{figure} -
Bibliography with Author-Year Citation in
preamble.tex:\RequirePackage[round, sort, numbers, authoryear]{natbib} -
Line spacing for the entire document can be specified in
preamble.tex. Uncomment the line spacing you prefer. e.g., \onehalfspacing
-
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
gis used to denote Greek Symbols, followed by-pior-sort_key. Use a-to separate sort key from the prefixes. The standard prefixes defined in this class are:-
Aora: Roman Symbols -
Gorg: Greek Symbols -
Zorz: Acronyms/Abbreviations -
Rorr: Superscripts -
Sors: Subscripts -
Xorx: Other Symbols
-
-
You can change the Title of Nomenclature to Notations or Symbols in the
preamble.texusing:\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 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
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
\tochidecommand.\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\textwidthrefers 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-pidenotes the Greek symbolpi.