How to write your MPhil thesis in LaTeX/Overleaf
What is LaTeX?
LaTeX is a document preparation system. You’re used to editors like Word, Google Docs, etc. Those editors are “What You See Is What You Get”: the interface where you edit your document looks exactly like the final document. For LaTeX, you write plain text with markup commands and LaTeX handles the typesetting. Your interface does not look like the compiled document. This takes a little while to get used to, but it’s great! You get to focus on content, LaTeX handles layout.
Why use it for your thesis?
- Professional typesetting, especially for mathematics
- Automatic numbering of sections, figures, tables, equations
- Reliable bibliography management
- Easy cross-referencing (figures, tables, equations, sections)
- Version-control friendly (plain text files)
- Consistent formatting across a long document
It does have a learning curve. The goal of this workshop is to get you past it quickly. You might also want to have a look at this wonderful free online course.
How it works
You write a .tex file. LaTeX compiles it into a PDF.
Errors are reported with line numbers (don’t panic — they’re usually readable).
\documentclass{article}
\begin{document}
Hello, world!
\end{document}Key concepts
- Commands start with a backslash:
\textbf{bold} - Environments have a
\begin{}and an\end{}:\begin{itemize} ... \end{itemize} - Packages extend functionality:
\usepackage{amsmath} - The preamble is everything before
\begin{document}. This is where you load your packages, define new commands, and basic layout of your document.
Overleaf
Overleaf is a browser-based LaTeX editor. No installation required!1 You write on the left, see the compiled PDF on the right.
Key features
- Real-time collaboration: You can share a link with your supervisor or co-authors.
- Track changes and comments (like Word’s edit mode)
- Version history: you can roll back
- Compiles for you: (no local LaTeX install needed, minimum setup)
Oxford provides institutional Overleaf Pro access.
Exercises (65 min)
By the end of this workshop, you’ll have an Overleaf template for your MPhil thesis ready to go! With:
- Title page
- Sections and a table of contents
- Text formatting: bold, italics, colour, footnotes, bullet points and numbered lists
- Cross-references
- Mathematics (inline and display)
- Tables
- Figures
- Citations and a bibliography
- Appendix
Exercise 1: Create your Overleaf account and first project (8 min, before class)
Exercise 2: Title page (8 min)
To add a title page to your document, you can use the built-in \maketitle:
\title{My MPhil Thesis Title}
\author{Your Name}
\date{June 2026}
\maketitleOr, for a custom title page (as most theses require), use a titlepage environment:
\begin{titlepage}
\centering
\vspace*{2cm}
{\LARGE\bfseries A Very Impressive Thesis Title\par}
\vspace{1cm}
{\LARGE MPhil Thesis\par}
\vspace{1cm}
% placeholder for Oxford college crest
\vspace{1cm}
{\Large Candidate number: XXX\par}
\vfill
{\large University of Oxford \\ Department of Economics\par}
\vspace{1cm}
{\large 08 May 2027\par}
\end{titlepage}Exercise 3: Structure - sections and table of contents (5 min)
Exercise 4: Text formatting (5 min)
Practice the following:
\textbf{bold text}
\textit{italic text}
\underline{underlined text}
\textcolor{blue}{coloured text} % requires xcolor package
Footnotes are easy.\footnote{This appears at the bottom of the page.}Lists:
\begin{itemize}
\item First bullet
\item Second bullet
\end{itemize}
\begin{enumerate}
\item First item
\item Second item
\end{enumerate}Exercise 5: Mathematics (10 min)
Inline maths uses $...$, display maths uses \[ ... \] or the equation environment:
The OLS estimator is $\hat{\beta} = (X'X)^{-1}X'y$.
\begin{equation}
\hat{\beta} = (X'X)^{-1}X'y
\label{eq:ols}
\end{equation}
As shown in equation \ref{eq:ols}, the estimator...- Greek letters:
\alpha,\beta,\gamma,\sigma,\epsilon. - Subscripts:
X_{it}. - Superscripts:
X^{2}.
This is also your first cross-reference: \label{eq:ols} tags the equation, and \ref{eq:ols} inserts its number wherever you use it. The same pattern works for sections, figures, and tables. \label{} right after the thing you’re labelling, \ref{} (or \autoref{}, which adds “Equation”/“Figure”/“Table” automatically) anywhere you want to point to it. Once hyperref is in your preamble, these references become clickable links in the PDF too.
Exercise 6: File structure (11 min)
For a thesis, keep each chapter in its own .tex file and use \input{} to pull it into your main document. Create a chapters/ folder for chapter files, a figures/ folder for images, a tables folder for the .tex of your tables and a frontmatter/ folder for the title page. This keeps your main file a clean skeleton and makes large projects much easier to navigate.
A minimal thesis skeleton could look like this:
% --- Define the document class ---
\documentclass[12pt, a4paper]{report}
% --- Packages ---
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amssymb} % maths
\usepackage{graphicx} % figures
\usepackage{hyperref} % clickable links & cross-refs
\usepackage{natbib} % bibliography
\usepackage{setspace} % line spacing
\usepackage{geometry} % margins
\usepackage{xcolor} % colour
\usepackage{booktabs} % nice tables
\usepackage{caption} % figure/table captions
% --- Basic Layout ---
\geometry{margin=2.5cm}
\doublespacing % or \onehalfspacing
\begin{document}
\input{frontmatter/titlepage}
\tableofcontents
\listoffigures
\listoftables
\input{chapters/01_introduction}
\input{chapters/02_litreview}
\input{chapters/03_data}
\input{chapters/04_results}
\input{chapters/05_conclusion}
\bibliographystyle{references}
\bibliography{references}
\appendix
\input{appendix/appendix_a}
\end{document}Exercise 7: Tables (16 min)
Tables use the tabular environment, wrapped in table for a float with a caption:
\begin{table}[h]
\centering
\caption{Summary Statistics}
\label{tab:summary_stats}
\begin{tabular}{lccc}
\toprule
Variable & Mean & SD & N \\
\midrule
Log wage & 2.34 & 0.45 & 1000 \\
Experience & 8.2 & 4.1 & 1000 \\
\bottomrule
\end{tabular}
\end{table}\toprule, \midrule, \bottomrule require the booktabs package. Always use these instead of \hline for publication-quality tables.
Typing tables by hand works for a handful of numbers, but for real results (regression output, summary statistics) you want R to generate the LaTeX for you. Then, when your data changes, you just re-run a script and your thesis updates with it: no manual re-typing, no transcription errors.
You can get LaTeX code from R using knitr::kable:
library(knitr)
summary_table <- kable(
summary_stats_df,
format = "latex",
booktabs = TRUE,
digits = 2,
col.names = c("Variable", "Mean", "SD", "N")
)
writeLines(summary_table, "tables/summary_stats.tex")Note that kable() with format = "latex" produces just the tabular environment: no caption, no label, no table float. That’s deliberate: you want to keep the content (generated by R, regenerated whenever your data changes) separate from the presentation (caption, label, positioning, written once in your .tex file).
In your main document:
\begin{table}[h]
\centering
\caption{Summary Statistics}
\label{tab:summary_stats_r}
\input{tables/summary_stats}
\end{table}Now if your data changes: re-run the R script, re-upload summary_stats.tex, recompile. The caption, label, and any \ref{tab:summary_stats_r} cross-references stay intact.
A few things to watch out for:
booktabs = TRUEgives you\toprule/\midrule/\bottomrule(matching the example above) — make sure\usepackage{booktabs}is in your preamble.kable()returns a vector of lines, not a single string. UsewriteLines(), orcat(summary_table, sep = "\n")if you prefercat.- By default
kable()escapes special characters (%,_,&) so they don’t break compilation. Don’t setescape = FALSEunless your text genuinely needs raw LaTeX commands. - The fiddly part is getting files from R into Overleaf: for a one-off table, drag-and-drop the
.texfile into Overleaf’s file tree. For a thesis with many tables that change often, look into Overleaf’s Git integration (Premium/Pro) so updated tables can be pushed directly. We’ll talk about Git and GitHub next Wednesday.
Exercise 8: Figures (7 min, if time allows)
You can add figures with the figure environment:
\begin{figure}[h]
\centering
\includegraphics[width=0.7\textwidth]{figures/my_plot.pdf}
\caption{Distribution of log wages by sector.}
\label{fig:wage_dist}
\end{figure}Exercise 9: Citations and bibliography (10 min)
LaTeX handles your citations and bibliography! No more last-minute reference fixes.
Exercise 10: Appendix (6 min, if time allows)
Your appendix contains additional information that is relevant, but too long to be included in the main text, such as: additional tables and figures, details on your data, interview transcripts, etc.
Your appendices are typically labelled A, B, C, …
\appendix
\chapter{Additional Tables}
\label{app:tables}
\begin{table}[h]
\centering
\caption{Robustness check}
...
\end{table}Some writing tips (10 min)
Writing process
- Learn how your brain likes to write.
- Keep a writing diary to plan your work and record how it went. This will let you pick up on what works on you and keep you motivated.
- Make a writing plan. It will change, but you should have one!
- Try free-writing or writing with an accountability buddy.
- People underestimate how much creativity is needed for non-fiction writing. Self-doubt, fear of judgement and anxiety stifle the creativity that you need for your writing process. Work with your brain, not against it.
- Stop where you want to continue to make the start the next day easier.
- Find your college’s Royal Literary Fund Fellow!
Writing stages
Writing has 4 stages:
1. Planning
- Work out the flow of the document. What’s your why? what? how?
- Set up Latex document: Skeleton outline.
- Name the main chapters and sections. What do each of these do for the document?
- Link your Zotero bibliography.
- Set up basic formatting
- Add in any figures or tables you already have, or add placeholders for them.
- You can write a draft introduction at this stage. Use it as a promise for your reader. Check any future writing against whether it delivers on that promise.
2. Structuring
- Section by section. Within sections, paragraph by paragraph.
- What do I want to say here? What does this part need to do? Does it rely on anything that should come earlier?
- Bullet point, then write. You can vomit-draft bullet points.
- Use
\paragraph{}or comments in LaTeX.
3. Writing
- Start with the paragraph that’s easiest to write.
- When you pick up your pen, don’t go back. That’s for editing!
- Leave to do boxes for edits, citations and facts to add.
- Use your introduction and conclusion as checkers.
4. Editing
- Come to editing with fresh eyes. You are switching perspectives from “reader” to “writer”.
- Give yourself time to not look at your writing before you edit. At least a week.
Editing has three steps:
4.1 Structural Edits
- Is everything in there? Is it in the right order?
- Work in your to do boxes.
- This is when you should start to ask other for feedback.
4.2 Line edits
- Is this clear? Could it be shorter? Should I be using the passive voice here? Is there a better citation? Does this need more signposting?
4.3 Proofreading
- Spelling mistakes
- Bibliography
- Formatting
A few LaTeX-specific writing habits worth building early
Add labels everywhere. Label every section, figure, table, and equation as you write it:
\label{fig:data_overview}. Reference with\ref{}or\autoref{}. LaTeX handles the numbering automatically.Comments. Use
%for notes to yourself that won’t appear in the PDF.One sentence per line in your
.texsource! This makes version control diffs readable and errors easier to locate.Avoid manual spacing. Never use
\\to force line breaks or\vspace{}to push things around. Fix the underlying structure instead.Draft mode. Add
\usepackage{draftwatermark}or use thedraftclass option while writing to suppress figure loading and speed up compilation.Leave to-dos for your future self and collaborators in LaTeX with the
todonotespackage.
\usepackage{todonotes}
...
\todo{Add robustness check here}
\todo[inline]{Expand this section}Further resources
- Overleaf Learn — comprehensive documentation
- jdleesmiller/latex-course — open-source slides for a three-part intro course (MIT licensed)
- Detexify — draw a symbol, get the LaTeX command
- Tables Generator — visual table builder
- Oxford thesis template on Overleaf