The 3 AM Formatting Nightmare
It's 3 AM. Your thesis defense is in two weeks. You just added a figure to Chapter 3, and now every figure number after it is wrong. The table of contents is broken. Word is freezing every time you scroll. You're considering switching to interpretive dance as your dissertation format.
This doesn't have to be your story.
Every year, thousands of PhD students discover LaTeX halfway through their thesis—and kick themselves for not starting sooner. LaTeX handles 200-page documents with hundreds of references like it was designed for them. Because it was.
This guide gives you everything: file organization, templates, cross-references, bibliographies, and the tricks that experienced thesis writers wish someone had told them.
Before You Start
Get the Right Template
Most universities provide official LaTeX thesis templates. Start there:
- Check your graduate school website
- Ask your department administrator
- Search for your university + "thesis template LaTeX"
These templates handle:
- Title page formatting
- Margin requirements
- Front matter structure
- Chapter heading styles
- Bibliography format
Starting with the official template saves hours of formatting work. You can also browse our thesis template gallery for professionally designed options.
Organize Your Files
A thesis has many files. Organize from day one:
thesis/
├── main.tex # Master document
├── preamble.tex # Packages and settings
├── frontmatter/
│ ├── abstract.tex
│ ├── acknowledgments.tex
│ └── dedication.tex
├── chapters/
│ ├── introduction.tex
│ ├── literature.tex
│ ├── methods.tex
│ ├── results.tex
│ └── conclusion.tex
├── appendices/
│ ├── appendix-a.tex
│ └── appendix-b.tex
├── figures/
│ ├── chapter-3/
│ └── chapter-4/
├── references.bib
└── thesis.cls # Custom class (if any)Document Structure
The Master Document
Your main.tex file is the conductor:
\documentclass[12pt, oneside]{report}
\input{preamble}
\begin{document}
% Front matter
\frontmatter
\input{frontmatter/titlepage}
\input{frontmatter/abstract}
\input{frontmatter/acknowledgments}
\tableofcontents
\listoffigures
\listoftables
% Main content
\mainmatter
\input{chapters/introduction}
\input{chapters/literature}
\input{chapters/methods}
\input{chapters/results}
\input{chapters/conclusion}
% Back matter
\backmatter
\input{appendices/appendix-a}
\bibliography{references}
\end{document}Front Matter
Front matter includes everything before Chapter 1:
% Title page (often specific format required)
\begin{titlepage}
\centering
\vspace*{2cm}
{\Huge\bfseries Your Thesis Title\par}
\vspace{1cm}
{\Large by\par}
{\Large Your Name\par}
\vspace{2cm}
{\large A thesis submitted in partial fulfillment...}
\end{titlepage}
% Abstract
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
Your abstract text here...
% Acknowledgments
\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}
Thanks to...Chapters
Each chapter is a separate file:
% chapters/introduction.tex
\chapter{Introduction}
\label{ch:introduction}
\section{Background}
\label{sec:intro-background}
Your research addresses a critical gap in...
\section{Research Questions}
\label{sec:intro-questions}
This thesis investigates three primary questions:
\begin{enumerate}
\item How does X affect Y?
\item What is the relationship between...
\item Can we predict...
\end{enumerate}
\section{Thesis Structure}
\label{sec:intro-structure}
Chapter \ref{ch:literature} reviews existing work...
Chapter \ref{ch:methods} describes the methodology...Essential Packages
The Preamble
Keep package declarations organized:
% preamble.tex
% Document setup
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
% Page layout
\usepackage[margin=1in]{geometry}
\usepackage{setspace}
\doublespacing
% Math
\usepackage{amsmath, amssymb, amsthm}
% Figures and tables
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{float}
\usepackage{subcaption}
% Bibliography
\usepackage[round]{natbib}
% References and links
\usepackage{hyperref}
\usepackage{cleveref}
% Code listings (if needed)
\usepackage{listings}
% Custom commands
\newcommand{\thesis}{\textit{Thesis Title}}Package Recommendations
| Need | Package |
|------|---------|
| Margins | geometry |
| Line spacing | setspace |
| Better tables | booktabs |
| Subfigures | subcaption |
| Smart references | cleveref |
| URLs | url or hyperref |
| Code | listings or minted |
Figures and Tables
Figure Organization
Keep figures organized by chapter:
\graphicspath{
{figures/}
{figures/chapter-3/}
{figures/chapter-4/}
}
% Then in your chapters:
\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{results-graph}
\caption{Experimental results showing...}
\label{fig:results-graph}
\end{figure}Subfigures
For multi-panel figures:
\usepackage{subcaption}
\begin{figure}[htbp]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{control-group}
\caption{Control group}
\label{fig:control}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{treatment-group}
\caption{Treatment group}
\label{fig:treatment}
\end{subfigure}
\caption{Comparison of control and treatment groups.}
\label{fig:comparison}
\end{figure}Tables
Use booktabs for professional tables (or use our table generator to create them visually):
\begin{table}[htbp]
\centering
\caption{Summary of experimental conditions}
\label{tab:conditions}
\begin{tabular}{lccc}
\toprule
Condition & Temperature & Duration & Samples \\
\midrule
A & 25°C & 24h & 50 \\
B & 37°C & 24h & 50 \\
C & 25°C & 48h & 50 \\
D & 37°C & 48h & 50 \\
\bottomrule
\end{tabular}
\end{table}Bibliography Management
BibTeX Basics
Maintain your .bib file throughout your PhD, not just when writing:
@article{smith2020,
author = {Smith, John and Doe, Jane},
title = {A Revolutionary Finding},
journal = {Journal of Important Science},
year = {2020},
volume = {42},
pages = {1--15},
doi = {10.1234/jis.2020.001}
}Citation Commands
With natbib:
\citet{smith2020} found that... % Smith and Doe (2020) found...
According to \citet{smith2020}... % According to Smith and Doe (2020)...
Previous work \citep{smith2020}... % Previous work (Smith and Doe, 2020)...Bibliography Style
Use the style required by your university:
\bibliographystyle{apalike} % or whatever your school requires
\bibliography{references}Cross-References
Labels
Label everything you might reference:
\chapter{Methods}
\label{ch:methods}
\section{Data Collection}
\label{sec:data-collection}
As shown in Figure \ref{fig:apparatus}...
Table \ref{tab:results} summarizes...
This is discussed further in Section \ref{sec:discussion}.Smart References with cleveref
The cleveref package automates reference formatting:
\usepackage{cleveref}
\Cref{ch:methods} describes... % Chapter 3 describes...
As shown in \cref{fig:results}... % As shown in Figure 4.2...
See \cref{tab:a,tab:b,tab:c}... % See Tables 2.1, 2.2, and 2.3...Managing Long Documents
Compiling Chapters Individually
For faster compilation during writing:
% At the start of main.tex:
\includeonly{chapters/methods}
% Your \include statements:
\include{chapters/introduction}
\include{chapters/literature}
\include{chapters/methods} % Only this compiles
\include{chapters/results}
\include{chapters/conclusion}Comment out \includeonly for the full document.
Draft Mode
Speed up compilation during writing:
\documentclass[12pt, draft]{report}Draft mode:
- Shows overfull/underfull box warnings
- Replaces images with placeholders
- Compiles faster
Compile Workflow
For the final document:
pdflatex main
bibtex main
pdflatex main
pdflatex mainYes, run LaTeX three times for all references to resolve.
Thesis-Specific Tips
Consistent Terminology
Define terms once:
% In preamble
\newcommand{\myterm}{Specific Technical Term}
\newcommand{\mytool}{\textsc{ToolName}}
% In text
We used \mytool{} to analyze \myterm{} data.TODO Notes
Track what needs work:
\usepackage[colorinlistoftodos]{todonotes}
\todo{Need to add more citations here}
\todo[inline]{Rewrite this section}
\missingfigure{Chart showing results}
% Get a list of all todos:
\listoftodosRevision Tracking
For advisor feedback:
\usepackage{changes}
\added{New text added}
\deleted{Text removed}
\replaced{new text}{old text}
% Or simpler highlighting:
\usepackage{soul}
\hl{Highlighted text for review}Common Thesis Problems
Overfull Boxes
Overfull \hbox (12.3pt too wide)The text extends past the margin. Solutions:
- Let LaTeX break the word:
\hyphenation{prob-lem-at-ic} - Force line break:
\\ - Allow slight margin overflow:
\sloppy(last resort)
Figure Placement
Figures floating to wrong locations:
% Force figure here
\begin{figure}[H] % Requires float package
% Or adjust float parameters
\renewcommand{\topfraction}{0.9}
\renewcommand{\bottomfraction}{0.9}
\renewcommand{\textfraction}{0.1}Bibliography Not Appearing
- Ensure you cite at least one source
- Run BibTeX after LaTeX
- Check
.bibfile is in the right location - Verify
\bibliography{}points to correct file (without.bibextension)
Pre-Submission Checklist
Before submitting:
- [ ] All chapters compile without errors
- [ ] All references resolve (no
??) - [ ] All citations exist (no missing references)
- [ ] Page numbers are correct
- [ ] Table of contents is up to date
- [ ] List of figures/tables is complete
- [ ] Bibliography is complete and formatted correctly
- [ ] Margins meet requirements
- [ ] Line spacing meets requirements
- [ ] Figure quality is sufficient for printing
- [ ] PDF is searchable (not scanned images)
Backup Strategy
A thesis represents years of work. Protect it:
- Version control: Use Git for all files
- Cloud backup: Sync to cloud storage
- Multiple locations: Keep copies in different places
- Regular commits: Commit after each writing session
git init
git add .
git commit -m "Initial thesis structure"
# ... work ...
git commit -m "Completed methods chapter first draft"Conclusion
Writing a thesis in LaTeX takes effort to learn, but pays dividends:
- Consistent formatting throughout
- Reliable cross-references
- Professional typography
- Easy bibliography management
- Handles 100+ pages without problems
Start with your university's template, organize your files well, and build your document incrementally. By the time you're done, you'll have a professional document you're proud to submit.
The thesis itself is hard enough. Let LaTeX handle the formatting so you can focus on the research.