Choosing and setting up a thesis template in LaTeX
A thesis is the longest document most researchers write in LaTeX, and the one with the strictest format. A good set-up at the start saves days at the end: chapters you can compile one at a time, figures that are found, a bibliography that behaves, and a title page the graduate school accepts at the first check. This guide covers choosing a template and organising the project around it.
Start with the rules, not the template
Before choosing anything, find your graduate school’s thesis guidelines and read them with the template question in mind. They usually fix the paper size and margins (often a wider binding margin), line spacing, font size, the wording and layout of the title page, the order of the front matter, page numbering, and how the bibliography is presented. Note whether the school checks the format before accepting the thesis: if it does, the guidelines are a specification, not advice.
A university class or a general template
- Your university’s own class, if there is a maintained one, is almost always the right choice where the format is checked. It encodes the rules for you. Ask the graduate school or recent graduates which version is current, since old copies circulate long after the rules change.
- A general template, built on the standard book or report class, memoir, or the KOMA-Script classes, suits a school that publishes rules but no class, or a thesis by publication. You set the margins, spacing and title page yourself, once, in the preamble.
Where the format is strict, do not fight the class. Keep your own additions in a small number of packages, avoid redefining what the class already sets (margins, headings, spacing), and compare a compiled page with the school’s checklist early, not in the last week.
One main file, one file per chapter
Keep the main file short: the class, the packages, and the order of the parts. Each chapter lives in its own file.
thesis/
main.tex
references.bib
frontmatter/ titlepage.tex abstract.tex acknowledgements.tex
chapters/ introduction.tex methods.tex results.tex conclusions.tex
appendices/ data.tex
figures/ introduction/ methods/ results/\documentclass[12pt,a4paper]{report} % or your university's class
\usepackage{graphicx}
\graphicspath{{figures/}}
\usepackage[style=authoryear]{biblatex}
\addbibresource{references.bib}
%\includeonly{chapters/methods} % compile one chapter while writing
\begin{document}
\pagenumbering{roman}
\include{frontmatter/titlepage}
\include{frontmatter/abstract}
\tableofcontents
\listoffigures
\listoftables
\cleardoublepage
\pagenumbering{arabic}
\include{chapters/introduction}
\include{chapters/methods}
\include{chapters/results}
\include{chapters/conclusions}
\printbibliography[heading=bibintoc]
\appendix
\include{appendices/data}
\end{document}\include, \input and \includeonly
\includeis for chapters. It starts a new page before and after the file, writes a separate .aux file for it, and takes the name without “.tex”. It cannot be used inside a file that was itself included: LaTeX stops with\include cannot be nested.\inputinserts a file exactly where it stands, with no page break. Use it for pieces inside a chapter, such as a long table, and for files that themselves bring in other files.\includeonly, in the preamble, compiles only the chapters it lists. Compile the whole thesis once first: the chapters left out keep their page numbers, cross-references and contents entries, which LaTeX reads from their .aux files from that earlier run.
Front matter
Typical front matter is the title page, a declaration or approval page, the abstract (often in two languages), acknowledgements, the table of contents, lists of figures and tables, and a list of abbreviations or symbols, numbered in roman numerals. With the book class, \frontmatter, \mainmatter and \backmatter switch the numbering and chapter numbering for you; with the report class, use \pagenumbering as above. Follow the school’s order exactly; it is one of the first things a format check looks at.
Figures
Keep figures in a folder per chapter and set \graphicspath once, with the double braces and the trailing slash shown above. Use PDF for plots and diagrams, which stay sharp at any size, and PNG or JPEG for photographs. Avoid spaces in file names, and remember that on most servers Fig1.png and fig1.png are different files.
One bibliography or one per chapter
Most schools want one bibliography at the end, as in the example, where heading=bibintoc also lists it in the table of contents. A thesis by publication sometimes needs one per chapter. With biblatex, load it with refsection=chapter and end each chapter with \printbibliography[heading=subbibliography]. Whichever you choose, keep a single .bib file for the whole thesis so a source is entered once.
Compiling a long document
latexmk -pdf main.texruns LaTeX, biber or BibTeX and the extra passes as many times as the document needs.- Work on one chapter at a time with
\includeonly, and use thedraftclass option to replace images with boxes while you write. - Fix the first error in the log first: later errors are often consequences of it.
- Keep dated copies or a version history, including of the version you send to your supervisor.
Doing it in Manulyx
The Manulyx template gallery has a Thesis category with university and general thesis classes, chapters in separate files, among them the official graduate-school classes of Middle East Technical University (METU), Erciyes University and Eskişehir Technical University. Every template is compiled before it is offered, and a thesis already begun can be imported as a .zip. The Bibliography category includes a set-up with a bibliography per section or chapter.
A thesis project has stages of its own: supervisor rounds are saved versions, the examination copy is frozen when you submit it for examination, and if the examiners ask for corrections a corrections stage opens with a statement of corrections. The marked manuscript then shows every change across every chapter file. See the thesis templates, Templates and the gallery, Stages for every kind of document and Manulyx for students.
More articles
- After a rejection: moving a paper to another journal's template
- Checking your references for retracted papers before you submit
- How to convert a Word document to LaTeX (equations included)
- How to write a response letter to reviewers
- How to make a marked (tracked-changes) manuscript in LaTeX
- Fixing common BibTeX and biblatex errors
- How Manulyx keeps the version you submitted
- How the marked manuscript is built
- How co-editing keeps your work safe
- All articles