LaTeX is the natural choice for a thesis in mathematics, physics, engineering or any field with formulas: flawless equations, automatic numbering, a table of contents and a bibliography that update themselves, and a professional finish that's hard to achieve in Word.
This guide takes you from zero to a working thesis project: where to write it, how to organize the files, a template you can copy, how to manage your bibliography and figures, and how to save hours by turning your handwritten notes into LaTeX.
Quick answer
To write your thesis in LaTeX, create a project in Overleaf (or install TeX Live or MiKTeX), split it into a main file and one file per chapter, use the report class, manage your references with BibLaTeX and a .bib file, and compile often. Before you start, check whether your university provides an official template, and use MathWrite to turn your handwritten notes and PDFs into LaTeX instead of retyping them.
Where to write it: Overleaf or a local installation
| Option | Advantages | Disadvantages |
|---|---|---|
| Overleaf (online) | Nothing to install, easy to share with your supervisor, live preview | Needs an internet connection; compile time is limited on the free plan |
| TeX Live or MiKTeX + an editor (TeXstudio, VS Code) | Works offline, no compile limits, full control | Installing it takes a while and needs several GB |
If it's your first LaTeX project, start with Overleaf: you'll be writing in five minutes, and you can move to a local installation later by downloading the project.
How to organize the project
Keep each chapter in its own file. The project is easier to navigate, and when something fails to compile you'll know where to look:
thesis/
├── main.tex
├── chapters/
│ ├── introduction.tex
│ ├── background.tex
│ ├── results.tex
│ └── conclusions.tex
├── figures/
└── references.bibThe main file loads the packages and includes each chapter with \include{chapters/introduction}. Each chapter file starts with \chapter{...} and contains only its content, without \documentclass or \begin{document}.
A template you can copy
This main.tex is a solid starting point: it compiles in Overleaf and in any up-to-date TeX distribution, and it includes what a typical thesis needs (margins, math, figures, professional tables, bibliography and clickable links):
main.tex
\documentclass[12pt,a4paper,oneside]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage[margin=2.5cm]{geometry}
\usepackage{amsmath, amssymb, amsthm}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage[backend=biber, style=numeric]{biblatex}
\usepackage[hidelinks]{hyperref}
\addbibresource{references.bib}
\graphicspath{{figures/}}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{definition}[theorem]{Definition}
\title{Title of Your Thesis}
\author{Your Name}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
\include{chapters/introduction}
\include{chapters/background}
\include{chapters/results}
\include{chapters/conclusions}
\printbibliography
\end{document}Many universities publish an official LaTeX template with the cover page, margins and fonts they require. If yours has one, use it, and apply the rest of this guide on top of it.
Bibliography with BibLaTeX
Save each reference once in references.bib and cite it wherever you need it with \cite{key}. Google Scholar and most databases let you export references in BibTeX format, so you rarely have to type them:
references.bib
@book{spivak2008calculus,
author = {Spivak, Michael},
title = {Calculus},
edition = {4},
publisher = {Publish or Perish},
year = {2008}
}When you compile, biber builds the numbered reference list at the end of the document. Overleaf does it automatically; locally, compile with latexmk, which runs biber for you and repeats the passes it needs.
Figures, tables and equations
These three patterns cover most of a thesis. Label everything with \label and refer to it with \ref or \eqref, so the numbering stays correct even if you reorder chapters:
\begin{figure}[htbp]
\centering
\includegraphics[width=0.7\textwidth]{diagram.png}
\caption{Description of the figure.}
\label{fig:diagram}
\end{figure}
\begin{table}[htbp]
\centering
\begin{tabular}{lcc}
\toprule
Method & Error & Time (s) \\
\midrule
A & 0.12 & 3.4 \\
B & 0.08 & 5.1 \\
\bottomrule
\end{tabular}
\caption{Comparison of methods.}
\label{tab:comparison}
\end{table}
\begin{equation}
\int_0^1 x^2 \, dx = \frac{1}{3}
\label{eq:integral}
\end{equation}
As Figure~\ref{fig:diagram} and Table~\ref{tab:comparison} show,
equation~\eqref{eq:integral} ... \cite{spivak2008calculus}Save hours: turn your notes into LaTeX
The slowest part of a thesis is often not writing but transcribing: derivations on paper, photos of the whiteboard, results in old PDFs. That's where MathWrite saves you the most time:
Handwritten notes and derivations
Take a photo of the page and get the LaTeX in seconds. See how.
Papers and PDFs
Convert PDFs typeset in LaTeX to reuse formulas and results. Guide.
Format and translate
Apply consistent academic formatting, or translate your abstract into another language while keeping the equations intact.
Word for your supervisor, slides for the defense
Export to .docx if your supervisor asks for it, and generate your Beamer presentation from the thesis.
Stop retyping your notes.
Convert your notes to LaTeXCommon errors and how to fix them
| Error | Usual cause | Solution |
|---|---|---|
Undefined control sequence | A misspelled command, or its package isn't loaded | Check the spelling and add the \usepackage it needs |
Missing $ inserted | A math symbol (_, ^, \alpha…) outside math mode | Put it between $...$, or write \_ for an underscore in text |
| References show as ?? | The document needs another compile pass | Compile again, or use latexmk, which repeats the passes automatically |
| Citations show the key in bold | Biber didn't run, or the key doesn't match the .bib | Check the key and compile with biber |
File not found with a figure | Wrong path or file name (case matters) | Check \graphicspath and the exact file name |
Overfull \hbox | A line that's too long (URLs, long formulas) | It's only a warning: split the formula or allow line breaks in URLs |
Tips to finish without stress
- Compile often: one error is easy to find, fifty accumulated errors are not.
- Keep backups: use Git or, at least, Overleaf's history and a regular download of the project.
- Write first, format later: until the last weeks, content matters more than margins.
- Agree on the delivery format (LaTeX, PDF or Word) with your supervisor from the start.
Frequently asked questions
Should I write my thesis in LaTeX or Word?
If your thesis has formulas, LaTeX: equations, numbering, cross-references and the bibliography are much more robust. If it's mostly text and your supervisor works in Word, Word may be enough. With LaTeX you can always export to Word if you need to.
Does my university have an official LaTeX thesis template?
Many universities publish one on their website or in Overleaf's template gallery. Search for your university's name followed by "thesis LaTeX template". If there isn't one, the template in this guide is a good starting point.
Which document class should I use?
report is the most common for a thesis: it has chapters and works well for single-sided documents. book is designed for double-sided printing, with chapters starting on odd pages.
How long does it take to learn LaTeX for a thesis?
The basics (sections, equations, figures and bibliography) can be learned in an afternoon. With a template and a tool that turns your notes into LaTeX, you can start writing the same day.
Can I write my thesis in Overleaf for free?
Yes. The free plan is enough for most theses; its main limits are compile time and the number of collaborators per project.
How do I get the equations from my handwritten notes into the thesis?
Take a photo and convert it with MathWrite: you'll get the LaTeX code ready to paste into the right chapter. Here's the step-by-step guide.
Write your thesis faster with MathWrite
Create your account and turn your handwritten notes, derivations and PDFs into LaTeX ready to paste into your thesis.
Start Converting for FreeTrusted by 20,000+ academics worldwide