View on GitHub

Thesis Template

A LaTeX thesis class template

Download this project as a .zip file Download this project as a tar.gz file

Thesis Template

A LaTeX thesis template that was tweaked over a few years and condensed to a class file. A BibTeX bibliography class file is also provided.

Table of Contents


On creating a new LaTeX document, start the document with \documentclass{thesis}. Options for the document are specified below. You should also define the macros \title{}, \author{}, \department{} and \university{} in the header of your document. The thesis class also provides an optional \dedication{} macro.

When writing the main body of your document, the macro \startpreamble can be called to generate the title page and switch page numbering to Roman numerals. You can then create sections with \section*{} for preamble content such as acknowledgements, abstracts and table of contents.

When declaring an end to the preamble, call the macro \stoppreamble to change page numbering back to Arabic numerals.

The thesis class imports the natbib package thus giving the option of paragraph citations (\citep{}) and text citations (\citet{}).

The class also provides shortcuts for declaring real numbers with \R{exponent_here}, expected values with \E{value}, Normal distributions with \N{mean}{variance} and probabilities with \p{value} or \p[value]{posterior}.

Optional document parameters

The \documentclass[options]{thesis} supports a number of options including the following:

Font support

The following fonts are supported and can be enabled using the corresponding documentclass option:

Nomenclature support

Nomenclature is supported with the nomencl package (see CTAN). New nomenclature can be defined as follows:


To compile the list of nomenclature, open up a terminal/command prompt session and run:

makeindex MyThesis.nlo -s -o MyThesis.nls

If the thesis file is something other than MyThesis, then MyThesis should be replaced in the above with the name of the master thesis file.

Nomenclature will be displayed wherever the macro \printnomenclature is called. The width of the first column can be defined by including an optional width (e.g. \printnomenclature[2cm]). The nomenclature section contains the following preamble:

A list of the variables and notation used in this thesis is defined below. The definitions and conventions set here will be observed throughout unless otherwise stated.

Should acronyms be detected (by detecting the presence of filename.acr), then the preamble will be appended with:

For a list of acronyms, please consult page~\pageref{gl:acronym}

Acronym support

Acronyms are supported with the glossaries package (see CTAN). New acronyms can be defined as follows:

\newacronym{label}{acronym}{lower case, singular expansion of the acronym}

Within the document, the commands \gls{label}, \Gls{label}, \glspl{label} and \Glspl{label} can be used in place of abbreviated forms. These commands correspond with the lowercase singular, sentence case singular, lowercase plural and sentence case plural forms, respectively. LaTeX will automatically expand the acronym on the first instance and use the abbreviated form thereafter.

Using the macro \printgloss will create a new chapter and write appendix items after they have been compiled. This macro will call either the \printglossaries or \printnoidxglossaries macro, depending on whether the texglossaries document option has been declared (see Using TeX-based glossary construction).

To compile the list of acronyms, open up a terminal/command prompt session and run:

makeglossaries MyThesis

If the thesis file is something other than MyThesis, then MyThesis should be replaced in the above with the name of the master thesis file.

It may be desirable to override the default behaviour in which case, the following commands can be used.

Acronym form

Expanded form

Expanded and acronym form

Words are made plural by simply appending “s” to the end of an acronym or its expanded form. Some words do not conform to this generalisation and may require the long plural form to be redefined using:

\newacronym[longplural={lower case, plural expansion of the acronym}]{label}{acronym}{lower case, singular expansion of the acronym}

Note: \newacronym definitions need to be defined prior to usage. I recommend placing such definitions within a separate file (e.g. Acronyms.tex) and using \input{Acronyms} just before opening the document environment.

Using TeX-based glossary construction

The above acronym compilation instructions required the use of terminal/command prompt and calling the makeglossaries command. On some systems, this requirement is undesirable or impossible to execute. By declaring texglossaries within the document declaration options, the template will switch to using the TeX-based glossary compiler.

To create a new chapter and write appendix items after they have been compiled, simply call \printgloss as before.

Note: Calling makeglossaries is generally more efficient to use and provides options for languages other than English. I recommend that you use makeglossaries wherever possible.

Multi-page floats

Floats such as figures and algorithms can span multiple pages with the included caption package (for tables, I recommend using the longtable environment described below). When wanting to declare the continuation of an algorithm, simply call \ContinuedFloat after opening the environment. This should then be followed by the caption macro (which should automatically use the same counter as the previous float).

    \caption{\textbf{My algorithm.}}
        \item [Step 1.] This is the first step.
        \item [Step 2.] This is the second step.

    \caption{\textbf{My algorithm (continued).}}
        \item [Step 3.] This is the third step.
        \item [Step 4.] This is the fourth step.


Sub-captions are supported via the subcaption package (see CTAN). To use sub-captions in a figure, declare a figure environment as normal and then use the subfigure environment to create subb figures:

            \caption{Image 1 caption
            \caption{Image 2 caption}
            \caption{Image 3 caption}
            \caption{Image 4 caption}
    \caption{\textbf{Main figure caption.}}


The thesis class creates a new float for algorithms that can be called with:

  \caption{The caption to your algorithm}
  % Content goes here

A list of algorithms can generated using the \listofalgorithms macro. This can be used in the same way as \listoffigures and \listoftables.

The thesis class also uses the listings package which provides support for writing source code in any of the supported programming languages or a user-defined language (see CTAN).


Several packages have been added improving or enhancing the formatting of tables. These are described in the following subsections.

Tables spanning multiple pages

Tables spanning multiple pages are supported with the longtable package (see CTAN). Simply declare the environment and add any necessary table headers and footers:

    \caption{\textbf{Table caption.} This caption is displayed on the first page.}\label{tab:TableCaption}\\
    \textbf{Column Header 1} & \textbf{Column Header 2}\\\hline
    \caption[]{\textbf{Table caption (continued).} This caption is displayed on subsequent pages.}\\
    \textbf{Column Header 1} & \textbf{Column Header 2}\\\hline
    \multicolumn{2}{r}{\emph{Continued on next page}}
    R1C1 & R1C2.\\ \hline
    R2C1 & R2C2.\\ \hline

Landscape tables

Landscape-oriented tables are supported using the rotating package (see CTAN). To rotate a table, encapsulate your caption, label and tabular environment within a sidewaystable environment:

    \caption{\textbf{Table caption.}}
            & \textbf{Column 2} & \textbf{Column 3} & \textbf{Column 4} & \textbf{Column 5} & \textbf{Column 6} & \textbf{Column 7}\\ \hline
        \textbf{Row 1} & R1C2 & R1C3 & R1C4 & R1C5 & R1C6 & R1C7 \\ \hline
        \textbf{Row 2} & R2C2 & R2C3 & R2C4 & R2C5 & R2C6 & R2C7 \\ \hline

Table row colours

Rows of a table can be given a background colour using the \rowcolour[color]{intensity} command, provided by the color and colortbl packages (see CTAN for color and colortbl packages). Simply append the command at the end of a table row for the row’s background to change. In the following example, the background of the row will be grey at 90% intensity:

$5.00$ & $-1.79$ \\ \hline \rowcolor[gray]{0.90}


The thesis class provides support for multiple appendix items. Appendices will create new chapters that are labelled alphabetically and each appendix item will appear in the table of contents. To declare the start of the appendix section, use the macro \appendix. New chapters from this point will form different appendix items.

\chapter{Before the appendix}
Lorem ipsum dolor sit amet...

\chapter{Appendix item 1} % Appears as "Appendix A"
Lorem ipsum dolor sit amet...

\chapter{Appendix item 2} % Appears as "Appendix B"
Lorem ipsum dolor sit amet...

\printglossaries % Appears as a new chapter called "Acronyms"

\bibliography{bibfile} % Appears as a new chapter called "Bibliography"


This class uses the natbib bibliography package and, specifically, the plainnaturl.bst bibliography stylesheet. The custom stylesheet displays initials and surname for all authors and removes URL and DOI information from bibliography entries. URL fields are preserved for miscellaneous/Internet bibliographic entries.

Note that the package prefers bibliographic information to be added as a separate bib file rather than appended to the bottom of a document.


The class file also has support for creating index items via the makeidx package (see CTAN). To create append the index to the end of the document and include it within the Table of Contents, use: