# Writing a thesis in LaTeX

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)
• 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.