Why write a thesis in LaTeX
LaTeX is a document preparation system: you write plain text with markup commands, and a TeX engine typesets it into a PDF. It is widely used for theses in mathematics, physics, computer science, engineering and economics because it handles equations, cross-references, numbered figures and tables, and large bibliographies reliably across hundreds of pages. The standard free introduction, The not so short introduction to LaTeX, is a good companion to this guide (Oetiker, 2021).
Before you start, check two things. First, your university's presentation rules: margins, line spacing, fonts, the order of preliminary pages and the declaration are set by regulation, not by LaTeX defaults (University of Manchester, 2026). Many universities or student societies publish a LaTeX thesis template that already meets them. Second, whether your supervisor and co-authors use LaTeX; if they comment in a word processor, agree a workflow early.
You need a TeX distribution (TeX Live or MiKTeX), which provides the engines, and an editor. Editors such as TeXstudio, or the online editor Overleaf, are not compilers: they call an engine for you. The engines are pdfLaTeX and the Unicode engines XeLaTeX and LuaLaTeX; the latter two make it easier to use system fonts and non-Latin scripts.
Structure: one main file, one file per chapter
A thesis is easier to manage as a main file that loads one file per chapter. The report and book classes provide chapters; the article class does not. The skeleton below shows a minimal main file.
| Line in thesis.tex | What it does |
|---|---|
| \documentclass[12pt,a4paper]{report} | Report class with chapters; 12-point text on A4 paper |
| \usepackage[margin=25mm]{geometry} | Sets margins; replace with your regulations' values |
| \usepackage{amsmath} | Mathematical environments such as align and \eqref |
| \usepackage{graphicx} | Provides \includegraphics for figures |
| \usepackage{booktabs} | Professional horizontal rules for tables |
| \usepackage[style=authoryear]{biblatex} | Bibliography and citations (choose the style your university requires) |
| \addbibresource{references.bib} | Points biblatex to your reference database |
| \usepackage{hyperref} | Clickable cross-references and links (usually loaded last) |
| \begin{document} | Start of the text |
| \include{chapters/introduction} | Inserts chapters/introduction.tex on a new page |
| \include{chapters/literature-review} | One line per chapter file |
| \printbibliography | Prints the reference list |
| \end{document} | End of the text |
While drafting, the command \includeonly{chapters/introduction} in the preamble compiles a single chapter while keeping page numbers and cross-references from the others. Sectioning inside each chapter uses \chapter, \section, \subsection and \subsubsection; LaTeX numbers them and builds the table of contents with \tableofcontents.
Front matter, appendices and lists
A thesis needs elements that a journal article does not: a title page, a declaration, an abstract, acknowledgements, a table of contents, lists of figures and tables, often a list of abbreviations, and appendices. Your regulations set their order and wording (University of Manchester, 2026), so build them to match.
- Number preliminary pages in roman numerals with \pagenumbering{roman}, then switch to arabic numerals with \pagenumbering{arabic} at the first chapter. The book class offers \frontmatter and \mainmatter for the same purpose.
- Generate the lists automatically with \tableofcontents, \listoffigures and \listoftables; they update from your captions and headings at each compilation.
- Start the appendices with \appendix, after which \chapter produces Appendix A, Appendix B and so on.
- Write the title page and declaration as separate files so that they can be adjusted to the regulations without touching the chapters.
- If you need a list of abbreviations or a glossary, use a dedicated package rather than a hand-made table, so that entries stay consistent with the text.
Line spacing, if your university requires 1.5 or double spacing, is best set with a package such as setspace rather than by changing low-level lengths, and margins with geometry as in the skeleton above. Check the printed or PDF result against the regulations before submission, including the binding margin if a printed copy is still required.
Figures and tables
Figures and tables are floats: LaTeX places them where they fit best, guided by placement options given to the figure or table environment, not to \includegraphics. The options are h (here), t (top of a page), b (bottom) and p (a separate page of floats); [htbp] lets LaTeX choose among all four (Oetiker, 2021). \includegraphics, from the graphicx package, takes size options such as width (Carlisle & LaTeX Project Team, 2026).
| Line | Purpose |
|---|---|
| \begin{figure}[htbp] | Start a float, with permitted placements |
| \centering | Centre the content |
| \includegraphics[width=0.8\textwidth]{figures/response-rates.pdf} | Insert a vector PDF at 80% of the text width |
| \caption{Response rates by survey wave.} | Numbered caption, also used in the list of figures |
| \label{fig:response} | A label for cross-referencing; place it after the caption |
| \end{figure} | End the float |
Refer to the figure in the text with Figure~\ref{fig:response}, never with "the figure below", because the float may move. Captions should explain what the reader is looking at, and default plotting settings are rarely the best choice for a thesis figure (Rougier et al., 2014). Export plots as vector PDF where possible so that text and lines stay sharp.
Tables use the tabular environment inside a table float. Columns are separated by & and rows end with \\. The booktabs package provides \toprule, \midrule and \bottomrule for clean horizontal rules; vertical rules are best avoided. For what to put in tables and figures, see tables and figures in a thesis.
Equations
Inline mathematics goes between single dollar signs, as in $y = \beta_0 + \beta_1 x$. For displayed equations, do not use the plain TeX form $$ ... $$: it is not LaTeX syntax and produces inconsistent vertical spacing (Trettin, 2007). Use \[ ... \] for an unnumbered display, or the equation environment for a numbered one.
| Need | Use | Avoid |
|---|---|---|
| Unnumbered display | \[ E = mc^2 \] | $$ E = mc^2 $$ |
| Numbered display | \begin{equation} ... \label{eq:model} \end{equation} | Typing numbers by hand |
| Several aligned lines | \begin{align} a &= b + c \\ d &= e \end{align} | eqnarray (not supported by amsmath) |
| Referring to an equation | \eqref{eq:model} | "the equation above" |
| Bold or italic text | \textbf{...}, \textit{...} | {\bf ...}, {\it ...} (obsolete) |
The amsmath package, maintained by the LaTeX Project, provides align, gather, multline, cases and many other environments (LaTeX Project Team, 2025); the American Mathematical Society's short guide is a concise reference to them (American Mathematical Society, 2017). Obsolete constructs such as eqnarray and the two-letter font commands (\bf, \it) still compile but cause spacing and font problems, which is why guides on LaTeX usage recommend replacing them (Trettin, 2007).
References with biblatex and biber
Store references in a .bib file, one entry per source with a citation key, for example @article{webster2002, ... }. Most reference managers can export to this format. biblatex controls how citations and the bibliography look, using styles written in LaTeX itself (Kime et al., 2026). Its recommended backend is biber, which supports full UTF-8 and flexible sorting (Charette & Kime, 2026).
- Cite in parentheses with \parencite{webster2002} and in running text with \textcite{webster2002}.
- Choose the style in the package options: style=authoryear, style=numeric, or a style package such as biblatex-apa (loaded with style=apa) if your university requires APA.
- Compile in the order: LaTeX, biber, LaTeX, LaTeX. Editors and Overleaf usually do this automatically.
- Check entries for capitalisation, missing DOIs and wrong entry types; exported records are often imperfect. See how to cite a doctoral thesis.
A working routine
- Start from your university's template, or set the class and geometry to match its regulations.
- Create one folder for chapters, one for figures and one .bib file; keep everything under version control (for example Git) or use Overleaf's history.
- Write with labels from the start: fig:, tab:, eq: and sec: prefixes keep cross-references readable.
- Compile often. When an error appears, read the first error in the log and the line number it gives; most errors are a missing brace or an unescaped special character such as %, & or _.
- Before submission, check overfull boxes, the table of contents, list of figures and tables, and that every citation and cross-reference resolves (no question marks in the PDF).
Collaboration needs a plan. If your supervisor reads PDFs, ask for comments as PDF annotations and keep a list of changes; if they prefer to edit directly, a shared Overleaf project or a Git repository lets you see every change. Converting a LaTeX chapter to a word-processor file for a reviewer is possible with conversion tools, but equations, citations and cross-references rarely survive intact, so agree the format of feedback before the first draft rather than converting each time.
For presenting code and algorithms in a thesis, see how to present computer code in a thesis; for the structure of the whole thesis, see structuring a PhD thesis.
Common mistakes
- Using $$ ... $$ or eqnarray for displayed equations instead of \[ ... \], equation or align.
- Giving placement options to \includegraphics instead of the figure environment, or forcing every float with [h].
- Referring to "the table below" instead of using a label and reference.
- Placing \label before \caption, which makes references point to the wrong number.
- Ignoring the university's presentation rules because the default LaTeX layout "looks professional".
- Inserting plots as low-resolution bitmaps rather than vector files.
- Keeping the whole thesis in one enormous file without version control.
Key takeaways
- Use a main file with one file per chapter and configure it to your university's presentation rules (University of Manchester, 2026).
- Placement options belong to the figure environment; \includegraphics controls size (Oetiker, 2021; Carlisle & LaTeX Project Team, 2026).
- Use \[ ... \], equation and align rather than $$ ... $$ and eqnarray (Trettin, 2007; LaTeX Project Team, 2025).
- Manage references in a .bib file with biblatex and biber (Kime et al., 2026; Charette & Kime, 2026).
- Write informative captions and do not trust plotting defaults (Rougier et al., 2014).
