Writing a Thesis or Dissertation in LaTeX
A 200-page thesis in Word is a formatting disaster waiting to happen — table of contents breaks, figure numbers drift, and styles cascade unpredictably. In LaTeX, none of that happens. This guide walks you through setting up a robust, maintainable thesis structure from scratch.
Why LaTeX for a Thesis?
Automatic numbering
Chapters, sections, figures, tables, and equations all renumber automatically when you add or remove content.
Consistent formatting
Define your style once in the preamble. Every heading, paragraph, and caption looks identical throughout the whole document.
Bibliography management
Cite with \cite{key} — BibTeX builds the full references list sorted and formatted to your institution's required style.
Stable large documents
A 300-page LaTeX document compiles as reliably as a 3-page one. Word becomes unstable and slow above ~80 pages.
Recommended File Structure
Split your thesis into one file per chapter and include them from a master file. This keeps each file manageable and lets you compile individual chapters during writing.
thesis/
├── main.tex ← master file
├── references.bib ← bibliography database
├── chapters/
│ ├── 01-introduction.tex
│ ├── 02-literature.tex
│ ├── 03-methodology.tex
│ ├── 04-results.tex
│ └── 05-conclusion.tex
├── frontmatter/
│ ├── abstract.tex
│ ├── acknowledgements.tex
│ └── declaration.tex
└── images/
├── fig1.pdf
└── fig2.pngThe Master File (main.tex)
\documentclass[12pt, a4paper, oneside]{book}
% Essential packages
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, margin=2.5cm]{geometry}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage{setspace}
\usepackage{microtype}
\onehalfspacing % 1.5 line spacing (common requirement)
\begin{document}
% ── FRONT MATTER ────────────────────────
\frontmatter % Roman page numbers (i, ii, iii...)
\begin{titlepage}
\centering
\vspace*{2cm}
{\ LARGE\bfseries Your Thesis Title\par}
\vspace{1cm}
{\large Your Full Name\par}
\vspace{0.5cm}
{A thesis submitted in partial fulfilment of the\par}
{requirements for the degree of Doctor of Philosophy\par}
\vspace{0.5cm}
{Department of Computer Science\par}
{University Name\par}
\vfill
{\large \today\par}
\end{titlepage}
\include{frontmatter/abstract}
\include{frontmatter/acknowledgements}
\include{frontmatter/declaration}
\tableofcontents
\listoffigures
\listoftables
% ── MAIN MATTER ─────────────────────────
\mainmatter % Arabic page numbers (1, 2, 3...)
\include{chapters/01-introduction}
\include{chapters/02-literature}
\include{chapters/03-methodology}
\include{chapters/04-results}
\include{chapters/05-conclusion}
% ── BACK MATTER ─────────────────────────
\backmatter
\bibliographystyle{plain}
\bibliography{references}
\appendix
% \include{chapters/appendix-a}
\end{document}A Chapter File
% chapters/01-introduction.tex
% Do NOT include \documentclass or \begin{document} here
\chapter{Introduction}
\label{chap:intro}
This thesis investigates...
\section{Motivation}
\label{sec:motivation}
The motivation for this work stems from...
\section{Research Questions}
This thesis addresses the following questions:
\begin{enumerate}
\item How does X affect Y?
\item Can method Z be applied to domain W?
\end{enumerate}
\section{Thesis Structure}
Chapter~\ref{chap:intro} introduces the problem.
The remainder of the thesis is structured as follows...Key Thesis Formatting Tips
During writing, add \includeonly{chapters/03-methodology} to compile only one chapter. Cross-reference numbers remain correct thanks to the .aux files from previous full compiles.
Use setspace: \onehalfspacing or \doublespacing. Most UK/US universities require 1.5× or 2× spacing for submission.
Define abbreviations once: \newacronym{ml}{ML}{Machine Learning}. The first use expands to 'Machine Learning (ML)', subsequent uses show 'ML' automatically.
Many universities require a wider left margin (e.g., 4cm) for binding. Set with \usepackage[left=4cm, right=2cm]{geometry}.
Start your thesis in the editor
Use the master file template above as your starting point — paste it in and compile immediately.
Start Writing