LaTeX Thesis Template [EN]

This page is in English since I intend to share it with the world. I used LaTeX to typeset my PHD thesis. I first published information about the code here. I was asked to publish the code from several people and therefore I tried to clean up the code and generated a template.

Visit http://tex.blogoverflow.com/2015/01/latex-thesis-template-manuel-kuehner/ to see the discussion with the $latex \LaTeX$ community about the template. I collect the suggestions from the community at the end of the post there.

Other thesis templates can be found in the discussion here.  Here I especially like the thesis template project from Siarhei Khirevich.

General Information

Information about the actual template can be found at the end of this website. First there is some general information about LaTeX.

Installing and Using LaTeX

Installing and using $latex \LaTeX$ differs greatly from your normal Microsoft Office experience. It’s very hard if you don’t know anybody who has already a great deal of experience with $latex \LaTeX$ and the related challenges. I made a video tutorial – which is publicly available – about installing LaTeX on a Windows 7 system:

In addition, there is also a video tutorial for MiKTeX showing how to manually add/install a package on a Windows 7 (or Windows 10) system:

Book Recommendations and Online Resources

The following websites/forums were a great help to me when I had questions regarding  LaTeX:

There are more popular forums like:

If you do not have good LaTeX skills then I recommend one of the following books:

Make sure the book you read explains Biblatex and not BibTeX! These are citation tools and Biblatex is the one you should use nowadays. BibTeX is outdated.

There are also free online resources that you should consider consulting the following resources:

The Template

Before we get to the actual template there are some impressions and remarks. In addition, you can download here a test document (PDF) produced using the template.

Impressions

Remarks

I tried to keep the template simple. It is very likely that you will have to add some features/packages. Keeping the template simple is important in order to allow as many people as possible to understand it. Here’s a list of packages which are already loaded:

  • scrbook (Document Class from KOMA-Script)
  • scrhack (KOMA-Script package)
  • marginnote (KOMA-Script package)
  • scrpage2 (KOMA-Script package)
  • geometry
  • inputenc
  • fontenc
  • babel
  • calc
  • graphicx
  • float
  • xcolor
  • booktabs
  • ragged2e
  • pgfplots
  • caption
  • hyperref
  • blindtext

As mentioned before, you will probably need to add packages. I assume that you will add packages that address math, symbols and fonts such as:

  • amsmath, mathtools and/or fixmath
  • textcompbbdingpifont and/or wasysym
  • mathpazohelvet and/or inconsolata

Regarding fonts make sure you visit the following  discussions on http://tex.stackexchange.com/:

In addition, you may need support for complicated tables, bibliography and typesetting units.

The source code is commented – please take the time to read the comments. Here’s an example:

 % Extended graphics support
 % There is also a package named 'graphics' - watch out!
 % CTAN: http://www.ctan.org/pkg/graphicx
 \usepackage{graphicx}

The template uses two colors as eye candy. In my opinion this leads to a more modern look of the document. The colors are defined in the main file:

% ####-Important-####
\definecolor[named]{myColorMainA}{RGB}{0,26,153}
\definecolor[named]{myColorMainB}{RGB}{174,49,54}

myColorMainA is a dark blue and myColorMainB is a dark red. You can reuse the colors like this:

\definecolor{myColorExample}{named}{myColorMainA}

I also used the named colors in my TikZ/PGF drawings as you can see in the example output of the template: Example Document (PDF)

The template comes in a ZIP file with a recommended folder structure:

> 00_Backup
> 01_Preamble
> 02_Chapters
> 03_GraphicFiles
> 04_Tables
> 05_Bibliography
> 06_Listings
> 99_AppendixFiles
Batch_CleanUp.bat
Batch_CompileFile.bat
MainFile.pdf
MainFile.tex

I suggest that you create every day a compressed archive (e. g. ZIP) of the project, name it accordingly (e. g. Backup_2015-02-25.zip) and put the archive in the backup folder.

In addition, I added two batch files for Windows/MiKTeX. One for deleting all auxiliary files and one for compiling the thesis using pdflatex:

  1. The first batch file is named Batch_CleanUp.bat and deletes all auxiliary files like .aux, .log and so on.
  2. The second batch file is named Batch_CompileFile.bat and calls Batch_CleanUp.bat, pdflatex and biberpdflatex is executed with some additional options which are useful when you have a large document and use the external option of TikZ/PGF.

Batch_CleanUp.bat

:: Delete all auxiliary files
del *.aux
del *.log
del *.gz
del *.blg
del *.bbl
del *.lof
del *.lot
del *.out
del *.ptc
del *.toc
del *blx.bib
del *run.xml
del *.bcf

Batch_CompileFile.bat

:: Delete all auxiliary files
rem --- 'rem' or '::' is the key word for comments in batch files like this

rem --- Call cleanup script in order to delete all auxiliary files ---
rem --- Sometimes after error messages there are still errors in the auxiliary files even if the root of the error was corrected in the tex file
:: ---
call my_Batch_CleanUp.bat
:: ---

rem --- First LaTeX run (pdflatex) with special options (more memory) for large LaTeX projects and tikz stuff (-shell-escape) ---
rem --- I use MiKTeX -- maybe you need another syntax if you use TeX Live for example ---
:: ---
pdflatex --extra-mem-top=60000000 -synctex=1 -shell-escape -interaction=batchmode MainFile.tex

rem --- Execute biber if used ---
:: ---
biber MainFile
:: ---

rem --- Compile three times to make sure everything is correct ---
:: ---
pdflatex --extra-mem-top=60000000 -synctex=1 -shell-escape -interaction=batchmode MainFile.tex
pdflatex --extra-mem-top=60000000 -synctex=1 -shell-escape -interaction=batchmode MainFile.tex
pdflatex --extra-mem-top=60000000 -synctex=1 -shell-escape -interaction=batchmode MainFile.tex
:: ---

The Actual Template (Download)

You can download the template here (ZIP file).