How to write your MPhil thesis in LaTeX/Overleaf

Author

Johanna Barop

Published

Invalid Date

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)

NoteExercises
  1. Go to overleaf.com and create an account (use your departmental Oxford email to access institutional Pro features). Verify your email.

  2. Click New Project → Blank Project. Name it mphil-thesis.

    You should see this interface:

    • File tree (left panel)
    • Editor (centre)
    • PDF preview (right)
    • Recompile button and auto-compile toggle
    • Logs and output panel for debugging errors
  3. Hit Recompile and confirm the PDF appears.

  4. Explore the interface: file tree, editor, PDF panel, and the logs.


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}
\maketitle

Or, 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}
NoteExercises
  1. Customise your title page with your thesis’ working title and candidate number.

Exercise 3: Structure - sections and table of contents (5 min)

NoteExercises
  1. Change your document class to report (better suited to thesis-length documents).

  2. Add at least three chapters and three subsections.

\tableofcontents

\chapter{Introduction}
\section{Motivation}
\section{Research Question}

\chapter{Literature Review}

\chapter{Data}
\section{Sampling strategy}
  1. Recompile. Notice the table of contents (toc) is generated and updated automatically.

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}
NoteExercises
  1. Try out bold, italics, colour, and a footnote.
  2. Add a bullet list of your thesis chapters.

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.

NoteExercises
  1. Typeset your main estimating equation (or one from your mini project, or a Core ERM problem set).
  2. Label it with \label{} and reference it with \ref{} somewhere in your text.

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.

NoteExercises
  1. Create this folder structure in your Overleaf project: move your title page into frontmatter/titlepage.tex and your introduction into chapters/01_introduction.tex.
  2. Confirm the project still compiles.

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.

TipTip

tablesgenerator.com lets you build tables visually and export LaTeX code.

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}
NoteExercises
  1. Generate LaTeX code for a table in R with knitr::kable(format = "latex"). Use a table from your mini project or most recent problem set.
  2. Save the result to a .tex file with writeLines().
  3. Upload that file to your Overleaf project (e.g. into a tables/ folder).
  4. Pull it in with \input{}, wrapped in your own table environment so you control the caption, label, and placement.
  5. Reference your table somewhere in your text with \ref{}, using the label you gave it in step 4.

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 = TRUE gives 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. Use writeLines(), or cat(summary_table, sep = "\n") if you prefer cat.
  • By default kable() escapes special characters (%, _, &) so they don’t break compilation. Don’t set escape = FALSE unless 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 .tex file 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.
TipTip

For regression tables, packages like modelsummary can write LaTeX directly to a file in one line, e.g. modelsummary(models, output = "tables/reg_results.tex").


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}
NoteExercises
  1. Export a plot from your last problem set in R as a PDF2 (ggsave("figures/my_plot.pdf")). Upload it to your figures folder in Overleaf, and include it with a \caption{} and \label{} as in the example above. Reference it in your text with \ref{}.
TipTip

Here’s how to add the University of Oxford crest to your title page! The Oxford thesis template on Overleaf includes the official crest as a PDF — download it from there and upload it to the figures folder of your Overleaf project. Then add \includegraphics[width=0.3\textwidth]{oxford_crest} to your title page environment.


Exercise 9: Citations and bibliography (10 min)

LaTeX handles your citations and bibliography! No more last-minute reference fixes.

NoteExercises
  1. Create a file called references.bib in your project. Add an entry:
@article{card1994,
  author  = {Card, David and Krueger, Alan B.},
  title   = {Minimum Wages and Employment},
  journal = {American Economic Review},
  year    = {1994},
  volume  = {84},
  number  = {4},
  pages   = {772--793}
}
  1. Reference the paper in your main file:
\usepackage{natbib}
...
\citet{card1994} find that...   % Card and Krueger (1994) find that...
...as shown in the literature \citep{card1994}.  % (Card and Krueger, 1994)
...
\bibliographystyle{agsm}
\bibliography{references}
  1. Add one more reference from Core ERM. Cite it in your introduction. Check that your bibliography compiles correctly. Tip: Export BibTeX entries directly from Google Scholar (click Cite → BibTeX).
TipTip

Overleaf links with Zotero, too! When you integrate your Zotero library with Overleaf, you won’t even have to manually update your .bibtex file anymore.


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}
NoteExercises
  1. Add an appendix chapter with a placeholder table or figure.

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 .tex source! 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 the draft class option while writing to suppress figure loading and speed up compilation.

  • Leave to-dos for your future self and collaborators in LaTeX with the todonotes package.

\usepackage{todonotes}
...
\todo{Add robustness check here}
\todo[inline]{Expand this section}

Further resources

Footnotes

  1. You might want to install a local .tex editor later, e.g. if you want to work offline.↩︎

  2. PDF or PNG both work, but PDF is preferred for vector graphics from R↩︎