Writing a thesis is a time-intensive endeavor. Fortunately, using LaTeX, you can focus on the content rather than the formatting of your thesis. The following article summarizes the most important aspects of writing a thesis in LaTeX, providing you with a document skeleton (at the end) and lots of additional tips and tricks.
Document class
The first choice in most cases will be the report
document class:
\documentclass[options]{report}
See here for a complete list of options. Personally, I use draft
a lot. It replaces figures with a box of the size of the figure. It saves you time generating the document. Furthermore, it will highlight justification and hyphenation errors (Overfull \hbox
).
Check with your college or university. They may have an official or unofficial template/class-file to be used for writing a thesis.
Title page
Again, follow the instructions of your institution if there are any. Otherwise, LaTeX provides a few basic command for the creation of a title page.
\title{This Is My Thesis Title} \author{Tom Texblog\\My University\\http://texblog.org} \date{June 07, 2012} \maketitle
Use \today
as \date
argument to automatically generate the current date. Leave it empty in case you don’t want the date to be printed. As shown in the example, the author command can be extended to print several lines.
For a more sophisticated title page, the titlespages package has a nice collection of pre-formatted front pages. For different affiliations use the authblk package, see here for some examples.
Contents (toc/lof/lot)
Nothing special here.
\tableofcontents \listoffigures \listoftables
The tocloft package offers great flexibility in formatting contents. See here for a selection of possibilities.
Often, the page numbers are changed to roman
for this introductory part of the document and only later, for the actual content, arabic
page numbering is used. This can be done by placing the following commands before and after the contents commands respectively.
\pagenumbering{roman} \pagenumbering{arabic}
Abstract
LaTeX provides the abstract environment which will print “Abstract” centered as a title.
\begin{abstract} ... \end{abstract}
The actual content
The most important and extensive part is the content. I strongly suggest to split up every chapter into an individual file and load them in the main tex-file.
In thesis.tex:
\include{chapter1} % path/filename.tex \include{chapter2} %\include{chapter3}
In chapter1.tex:
\chapter{Introduction} Some text...
This way, you can typeset single chapters or parts of the whole thesis only, by commenting out what you want to exclude. Remember, the document can only be generated from the main file (thesis.tex), since the individual chapters are missing a proper LaTeX document structure.
See here for a discussion on whether to use \input
or \include
.
Bibliography
The most convenient way is to use a bib-tex file that contains all your references. You can download bibtex items for articles, books, etc. from Google scholar or often directly from the journal websites.
\bibliographystyle{plain} \bibliography{literature} % path/filename.bib
Two packages are commonly used to personalize bibliographies, the newer biblatex and the natbib package, which has been around for many years. These packages offer great flexibility in customizing the look of a bibliography, depending on the preference in the field or the author.
Other commonly used packages
- graphicx: Indispensable when working with figures/graphs.
- subfig: Controlling arrangement of several figures (e.g. 2×2 matrix)
- minitoc: Adds mini table of contents to every chapter
- nomencl: Generate and format a nomenclature
- listings: Source code printer for LaTeX
- babel: Multilingual package for standard document classes
- fancyhdr: Controlling header and footer
- hyperref: Hypertext links for LaTeX
- And many more
Minimal example code
\documentclass[12pt]{report} \begin{document} \title{A Sample Thesis Title} \author{Tom Texblog} \maketitle \pagenumbering{roman} \tableofcontents \listoffigures \listoftables \begin{abstract} ... \end{abstract} \pagenumbering{arabic} \include{chapter1} \include{chapter2} \include{chapter3} \bibliographystyle{plain} \bibliography{literature} \end{document}
I’m aware that this short post on writing a thesis only covers the very basics of a vast topic. However, it will help you getting started and focussing on the content of your thesis rather than the formatting of the document.
domwass
I would rather recommend a documentclass like memoir or scrreprt (from KOMA-Script), since they are much more flexible than report.
tom
I agree, my experience with them is limited though. Thanks for the addendum.
Here is the documentation: memoir, scrreprt (KOMA script)
Best, Tom.
copiancestral
Nice post Tom. I’m actually writing a two-part (or three) on Writing the PhD thesis: the tools. Feel free to comment, I hope to update it as I write my thesis, so any suggestions are welcome.
tom
Thanks for the link. I just saw your post and thought I should really check out git sometimes :-). Best, Tom.
copiancestral
Yes, git is awesome. It can be a bit overwhelming with all the options and commands, but if you’re just working alone, and probably on several machines, then you can do everything effortlessly with few commands.
tom
That’s what has kept me so far. But I’ll definitely give it a try. Thanks!
Vita Smid (@ze_phyr_us)
What a great overview. Thank you, this will come handy… when I finally get myself to start writing that thesis 🙂
tom
Thanks and good luck with your thesis! Tom.
Uwe
Hi, I can recommend two important packages: lineno.sty to insert linenumbers (really helpful in the debugging phase) and todonotes (allows you to insert todo-notes for things you still have to do.)
tom
Thanks Uwe!
I wrote an article on both, lineno and todonotes. Here is the documentation: lineno and todonotes for more details.
Best, Tom.
gorfou
Hi!
Thanks for the post, i’m currently writing my master thesis 🙂
A small note: it seems that subfig is deprecated for the subcaption package:
https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Subfloats
tom
Hey, thanks for the tip. Too bad they don’t say anything in the documentation apart from the fact that the packages are not compatible.
Best, Tom.
nick
good thesis template can be also found here (free):
http://enjobs.org/index.php/downloads2
including living headers, empty pages, two-sided with front and main matter as well as a complete structure
tom
Hi Nick,
Thanks for the link to the thesis template!
Best, Tom
JavierJavier
Hi Tom, I’m writing a report on spanish in LaTex, using emacs, auctex, aspell (~170pags. ~70 files included by now) and this blog is my savior every time because I’m quite new with all these.
The question: Is there anyway (other than \- in every occurrence) to define the correct hyphenation for accented words (non english characters like é)?
I have three o four accented words, about the subject of my report, that occur near 100 times each, across several files, and the \hyphenation{} command can’t handle these.
tom
Hi!
I was wondering what packages you load in your preamble. For a better hyphenation (and easier typing), you should use these packages:
See here for more details.
If this doesn’t help, please provide a minimal working example to illustrate the problem.
Thanks, Tom.