April 4, 2026

Writing a thesis or dissertation in LaTeX produces a professional, consistently formatted document that handles hundreds of pages without breaking. This guide covers everything from choosing the right document class to managing your bibliography and organizing multi-chapter projects.
Most universities offer (or require) LaTeX templates for theses. Even when Word is acceptable, LaTeX has practical advantages for long documents:
The document class determines your thesis layout. Most universities provide their own class file. If yours doesn't, start with one of these:
report — The standard LaTeX class for long documents with chapters. A safe default.book — Similar to report but adds front/back matter separation and two-sided printing by default.memoir — A flexible class with extensive customization options. Good if your university doesn't provide a template.\documentclass[12pt, a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{references.bib}
\title{Your Thesis Title}
\author{Your Name}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
\include{chapters/introduction}
\include{chapters/literature-review}
\include{chapters/methodology}
\include{chapters/results}
\include{chapters/conclusion}
\printbibliography
\end{document}Don't put everything in one file. Split your thesis into separate files for each chapter:
thesis/
├── main.tex % Master file
├── references.bib % Bibliography database
├── chapters/
│ ├── introduction.tex
│ ├── literature-review.tex
│ ├── methodology.tex
│ ├── results.tex
│ └── conclusion.tex
├── figures/
│ ├── fig1.pdf
│ └── fig2.png
└── appendices/
└── appendix-a.texUse \include{} for chapters (adds page breaks) or \input{} for smaller sections you want to inline. The \includeonly{} command in the preamble lets you compile just one chapter at a time during writing, which speeds up iteration.
geometry — Set page margins. \usepackage[margin=1in]{geometry}setspace — Double-spacing for review drafts. \doublespacingfancyhdr — Custom headers and footers with chapter titles and page numbers.biblatex — Modern bibliography management. Supports every citation style.hyperref — Clickable cross-references and table of contents links. Use [hidelinks] to remove colored boxes.cleveref — Smart cross-references that automatically say "Figure 1" or "Equation 3" instead of just the number.booktabs — Professional-looking tables with \toprule, \midrule, and \bottomrule.subcaption — Sub-figures and sub-tables within a single float.Most theses need a title page, abstract, acknowledgments, and table of contents before the main chapters. With the report or book class, you can use \frontmatter, \mainmatter, and \backmatter (in book) to switch page numbering styles automatically:
% Title page
\begin{titlepage}
\centering
\vspace*{2cm}
{\Huge\bfseries Your Thesis Title\par}
\vspace{1.5cm}
{\Large Your Name\par}
\vspace{1cm}
{\large A thesis submitted for the degree of\\
Doctor of Philosophy\par}
\vspace{1cm}
{\large Department of Computer Science\\
University Name\par}
\vfill
{\large \today\par}
\end{titlepage}
% Abstract
\begin{abstract}
Your abstract text here. Keep it under 300 words.
\end{abstract}
% Table of contents
\tableofcontents
\listoffigures
\listoftablesCreate a references.bib file with your BibTeX entries. Use biblatex with biber as the backend for the most flexible and modern approach:
% In your preamble
\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{references.bib}
% In your text
As shown by \textcite{smith2024}, the results indicate...
This has been confirmed \parencite{jones2023, lee2025}.
% At the end of your document
\printbibliographyInstead of manually writing BibTeX entries, paste a DOI or arXiv ID into Underleaf's citation generator and get a properly formatted entry in seconds.
Try Citation GeneratorLabel everything and reference it by label. Never hard-code numbers:
\chapter{Results}
\label{ch:results}
As discussed in \Cref{ch:methodology}, we used...
\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\linewidth]{figures/fig1.pdf}
\caption{Accuracy across model sizes.}
\label{fig:accuracy}
\end{figure}
\Cref{fig:accuracy} shows that accuracy improves with scale.The cleveref package (\Cref) automatically prepends "Figure", "Chapter", or "Table" to the reference. If you reorder chapters or figures, all numbers and labels update on the next compile.
\includeonly — Compiling a full 200-page thesis every time you change a sentence is slow. Use \includeonly{chapters/results} to compile just the chapter you're working on.biblatex requires running the biber command between LaTeX compilations. The sequence is: pdflatex → biber → pdflatex → pdflatex. Overleaf handles this automatically.\sloppy (globally) or \begin{sloppypar} (locally), or rephrase the sentence.[H] placement specifier from float forces figures to appear exactly where you put them, which usually creates ugly page breaks. Use [htbp] and let LaTeX optimize placement.A few practical tips for maintaining momentum:
% TODO: cite source for this claim comments so you can keep writing without stopping to look up every reference.Underleaf's AI tools can help with your thesis workflow — from generating abstracts to converting reference PDFs to LaTeX to finding citations directly in Overleaf with our Chrome extension.
Try Underleaf FreeEmpowering students and researchers with AI-powered tools for academic writing.
Go to appContact us© 2026 Underleaf. All rights reserved.