This template is a general template for scientific theses. Currently, it is the unofficial LaTeX template for Master, Bachelor, Diploma, and Student Theses at the computer science departments listed below, each with example PDFs; other departments are untested. The template will be extended to support theses from more institutions.
The LaTeX snippets this template is assembled from can be inspected at https://latextemplates.github.io/latex-snippets/.
- 🇺🇸 English example
- 🇺🇸 English example using the listings package (instead of minted) for source code
- 🇩🇪 German example
- 🇩🇪 German example using the listings package (instead of minted) for source code
-
Download
- Go to the development version at https://github.com/latextemplates/scientific-thesis-template/archive/main.zip. Reason: LaTeX packages change so fast over time and we cannot do a release on each change.
- Extract
scientific-thesis-template-main.zipto the directory you want to work. E.g.,c:\users\user\documents\thesis.
-
Start texing
- University of Stuttgart:
- English:
main-english.tex - German:
main-german.tex - Without Python (see below):
main-basic-listings-english.tex,main-basic-listings-german.tex
- English:
- The text is in
chapters-en/(English) andchapters-de/(German), one file per chapter (e.g.,chapters-en/10 - introduction.tex), which the main files include. The numbers go in steps of 10, so a new chapter fits in between (e.g.,chapters-en/25 - my chapter.tex).
- University of Stuttgart:
-
Compile with "lualatex + biber" in your TeX editor or with
latexmk main-english/makeon the command line.
See docs/overleaf.
- Read Student Thesis Projects by Lichter, Ludewig, Deininger, and Schneider. The open-access book explains how to organize, conduct, write, and present a thesis.
- Before handing in, work through the thesis checklist.
Following features are enabled in this template:
- (Optional) Typesetting of listings using advanced highlighting powered by the minted package.
mintedprovides better output than listings, but requires latexminted to be installed. - Numbered research questions:
\defRQprints "Research Question 1 (RQ1)",\refRQreferences it as "RQ1". This is enabled by the refenums package;refenums.styis part of this repository, because TeX Live contains an older version. - Generated PDF allows for copy and paste of text without getting words with ligatures such as "workflow" destroyed.
With pdfLaTeX, this is enabled by
glyphtounicode, which encodes ligatures (such as fl) using unicode characters; LuaLaTeX does this by itself. - Ligatures are removed if they are typeset at the wrong place. This is enabled by the selnolig package.
- Support of hyperlinked references without extra color thanx to hyperref.
- Better breaking of long URLs.
- Support for
\powersetcommand. - Support todos as pdf annotations. This is enabled by the pdfcomment package.
- microtypographic extensions for a better look of the paper.
- Modern packages such as microtype, zref-clever, csquotes, paralist, hyperref, hypcap, upquote, booktabs.
- LaTeX compilation using the modern lualatex compiler. For older systems, pdflatex is still supported.
- biblatex+biber instead of plain bibtex to have a more intuitive
.bibfile: Unicode (UTF-8) is fully supported and commands such as\citeauthor{...}work out of the box. See also https://tex.stackexchange.com/q/8411/9075. - latexmk for easy compilation of the LaTeX document.
- Ready-to-go configuration for latexindent.
- Proper hyphenation and microtype for English texts.
- Hints on writing an abstract and thesis by Dirk Fahland.
Following features were not activated for this template. You can run the latex template generator to enable the features.
Congratulations. You chose to use all available features.
- chapters-en, chapters-de One file per chapter (English, German), included by the main file.
The chapter on Markdown is a plain Markdown file (
.md), included with\markdownInput(LuaLaTeX only). The source code example of the LaTeX hints is a file of its own for each of the minted and listings packages. - figures Directory containing the figures. By using LuaLaTex/PDFLaTeX it is possible to use PDF, JPG, and PNG files. We recommend to use PDFs to enable smooth scaling.
main-english.tex- The main.texfile loading all LaTeX packages and their configurations.- Add or remove chapters here
- Adjust title, … here
- bibliography.bib - Bibliography. biblatex format. Manage it with JabRef.
- abbreviations.tex - Acronyms and abbreviations.
- commands.tex - Example LaTeX macros.
Following additional files are included, which do not need to be adapted:
- localSettings.yaml - Settings for latexindent
- Makefile - The Makefile. Builds on latexmk.
- Texlivefile - List of packages required for a minimal TeXLive installation.
Compile either in a Docker container (recommended) or with a LaTeX distribution installed on your machine.
The TeX Live docker image by the Island of TeX works the same on Windows, macOS, and Linux.
It ships a complete TeX Live including latexmk, biber, latexindent, Python, and latexminted.
Thus, minted works out of the box - also on Windows, without a separate Python setup.
-
Install Docker (Docker Desktop on Windows and macOS).
-
Open a terminal in the directory of this document and compile in the container. The first run downloads the image (approx. 3 GB); its tag selects the TeX Live version of this template.
Windows (PowerShell):
docker run --rm -v "${PWD}:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest latexmk main-english
Windows (Command Prompt):
docker run --rm -v "%cd%:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest latexmk main-englishLinux and macOS:
docker run --rm -v "$PWD:/workdir" registry.gitlab.com/islandoftex/images/texlive:latest latexmk main-english -
Optional: Let VS Code compile in the container, see "VS Code configuration".
If you need additional tools in the image, extend the generated Dockerfile, build it with docker build -t ltg ., and use ltg instead of the image name.
Install a LaTeX distribution on your machine:
- Windows: Recent MiKTeX. MiKTeX installation hints are given at http://latextemplates.github.io/scientific-thesis-template/#installation-hints-for-windows.
- macOS: Recent TeX Live (e.g. through MacTeX) - Try
sudo tlmgr update --allif you encounter issues with biblatex - Linux: Recent TeX Live distribution
See <docs/latex-setup.md> for refined installation instructions.
To have minted running with a traditional installation, you have to do following steps on Windows (the Docker image already contains all of this):
- Install python:
choco install python- that uses chocolatey to install Python - Install latexminted:
pip install latexminted- that uses the Python package manager to install the minted library
latexmk runs the LaTeX tools (e.g., lualatex and biber) as often as needed to get the final PDF (why latexmk is great).
It reads its configuration from .latexmkrc in the directory of the document.
Overleaf reads .latexmkrc, too, so the "Compiler" setting of the Overleaf project does not matter; select TeX Live 2026 there.
To use the configuration for all your documents, put it at the right place.
Build the document:
latexmk main-englishIn the Docker-based setup, put the docker run ... part from "Docker-based (recommended)" in front, or just run make.
In the traditional setup, latexmk needs Perl (TeX Live ships it; with MiKTeX, install it, e.g., via choco install strawberryperl).
To recompile on every change and open the PDF, run:
latexmk -pvc main-englishOn Windows, the configuration opens the PDF in Sumatra PDF, which reloads the PDF automatically.
On the command line, there are additional features:
makebuilds the PDF in the Docker container;make LOCAL=1uses your local LaTeX distribution (this works for allmaketargets)latexmk -Cormake cleanfor cleaning upmake logshows only the relevant messages of the last LaTeX run (using texlogsieve)make formatto reformat the.texfiles (one sentence per line and indent)make spellcheckruns all spell checkers (in the Docker image by DANTE e.V., which contains them;make LOCAL=1 spellcheckuses local installations):make spellcheck-aspellfor interactive spell checking with aspellmake spellcheck-textidotechecks spelling, grammar, and style with TeXtidote (report intextidote.html, for the chapters inchapters-*/*.textidote.html)
make dictionariesmerges the word lists of the spell checkers (see the FAQ on adding words)make stand: Creates a new PDF with the current status of the document.make view: Opens the configured viewermake mrproper: Cleans up and removes also editor backup files.
Without make (e.g., on Windows), run a target with make in the Docker image by DANTE e.V., which contains make and all tools, e.g., dictionaries:
docker run --rm -it -v "${PWD}:/workdir" -w /workdir danteev/texlive:2026-C make LOCAL=1 dictionariesdocker run --rm -it -u "$(id -u):$(id -g)" -e HOME=/tmp -v "$PWD:/workdir" -w /workdir danteev/texlive:2026-C make LOCAL=1 dictionariesThe textlint job of the Check workflow reports weakening words (e.g., "clearly", "just") in the English .tex files as annotations.
Run it locally with npx (needs Node.js; rules come from .textlintrc.json):
npx --yes --package textlint --package textlint-plugin-latex2e --package textlint-filter-rule-allowlist --package textlint-rule-terminology --package textlint-rule-write-good textlint main-english.tex chapters-en/*.tex chapters-en/*.mdThe textidote job of the Check workflow checks spelling, grammar, and style of English documents with TeXtidote and reports its findings as annotations.
Its options are in .textidote.
Run it locally with make spellcheck-textidote: it writes the report textidote.html (for the chapters: chapters-*/*.textidote.html).
The "LaTeX Hints" chapter shows UML diagrams drawn with MetaUML and pgf-umlsd, which need no further tools. PlantUML and Mermaid offer a more compact syntax and lay out the diagrams automatically, but need further tools: they are contained in the Docker image by DANTE e.V.. To use them, generate an own copy of this template with the latex template generator:
npx -p yo -p generator-latex-template -c 'yo latex-template --documentclass=scientific-thesis --latexcompiler=both --overleaf=true --texlive=2026 --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true --uml=plantuml --docker=dante'Use --uml=mermaid for Mermaid.
The generator asks for the remaining options (institution, language, and package for source code), which distinguish the main*.tex files of this template.
Currently, following extensions are recommended:
- LaTeX Workshop to support LaTeX in VS Code and
- LaTeX Utilities to enhance LaTeX Workshop
- LTeX+ to have a nice spell checker that also identifies grammar issues
- JabRef 4 VSCode to use the language server and further features of JabRef in VS Code
With the settings below, LaTeX Workshop compiles with the recipe "lualatex ➞ biber ➞ lualatex × 2".
To compile in the Docker container (see "Docker-based (recommended)"), add the following lines to VS Code's settings.json (Shift+Ctrl+P, then "Preferences: Open Settings (JSON)"):
"latex-workshop.docker.enabled": true,
"latex-workshop.docker.image.latex": "registry.gitlab.com/islandoftex/images/texlive:latest",The following settings are additionally recommended:
{
"editor.wordWrap": "on", // enable soft line breaks
"latex-workshop.view.pdf.viewer": "tab", // display the generated PDF in a separate tab
"latex-workshop.view.pdf.color.light.backgroundColor": "#cccccc", // light theme: use a darker background in the PDF viewer to lift the pages off it
"latex-workshop.view.pdf.color.dark.backgroundColor": "#121314", // dark theme: same, with a dark gray matching the editor
"latex-workshop.latex.autoBuild.run": "never", // never automatically build; alternative: "onSave" (on saving .tex files)
"editor.renderWhitespace": "all", // display all whitespaces
}Alternatively, just copy and paste the contents of the vscode.settings.json file to your VS Code settings file.
You can manually trigger compilation by hitting the green button in the extension or using other methods provided by LaTeX Workshop.
LTeX+ is an offline grammar and spell checker with support for LaTeX and Markdown.
The main file starts with a magic comment that tells LTeX+ the language of the document, e.g., % LTeX: language=en-US.
Add the same comment to further .tex files.
In case something goes wrong, you can instruct the LaTeX compiler to stop at the first error:
lualatex --synctex=1 main-englishRun biber main-english to get the bibliography rendered (execute lualatex afterwards).
The complete output reads:
! Package minted Error: minted v3+ executable is not installed, is not added to
PATH, or is not permitted with restricted shell escape; or MiKTeX is being use
d with -aux-directory or -output-directory without setting a TEXMF_OUTPUT_DIREC
TORY environment variable.
The minted package needs Python and the Python package latexminted. The Docker image and Overleaf contain both. For a local installation:
- Install Python, e.g.,
choco install pythonon Windows. - Install or repair latexminted:
python -m pip install --force-reinstall latexminted(see minted#425).
Without Python, use the *-basic-listings*.tex variant: it typesets source code with the listings package.
Use the \foreignlanguage{language}{text} command.
LTeX+ will detect these elements and automatically switch the spell checker's language.
For example:
\foreignlanguage{english}{Therefore, our proposed approach will change the world.}Each spell checker reads its own word list; add the word as a new line:
| Spell checker | Word list |
|---|---|
aspell (CI job spell-check, make spellcheck-aspell) |
.aspell.en.pws (English), .aspell.de.pws (German); below the first line, no hyphenated words |
| LTeX+ (VS Code) | .vscode/ltex.dictionary.en-US.txt, .vscode/ltex.dictionary.de-DE.txt; "Add to dictionary" in VS Code writes there |
TeXtidote (CI job textidote, make spellcheck-textidote) |
.textidote.dict |
typos (CI job typos) |
.typos.toml, section [default.extend-words], e.g., Heros = "Heros"; only needed if typos reports the word |
The word lists of aspell, LTeX+, and TeXtidote contain the same words.
Instead of editing each of them, add the word to the aspell or the LTeX+ word list and run make dictionaries: it merges both and writes the word into all of them (hyphenated words not into aspell's).
On GitHub, the workflow Dictionaries does this after each push that changes one of these word lists and commits the result.
To remove a word, delete it from the aspell and the LTeX+ word list and run make dictionaries.
- Initialize your git repository as usual
- Add this repository as git remote:
git remote add template https://github.com/latextemplates/{template}.git - Merge the branch
template/maininto yourmainbranch:git merge template/main.
After that you can use and push the main branch as usual.
Notes on syncing with the upstream repository are available from GitHub.
Q: I get the error ! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts.
Install the cm-super package using the MiKTeX package manager. Then, run initexmf --mkmaps on the command line. (Long description: https://tex.stackexchange.com/a/324972/9075)
A: You have activated \MakeOuterQuote{"} and used some special babel command to allow hyphenation at other places as a dash. One example is writing application"=specific.
Now, you have to decide whether you want keep using plain quotes to enquote a word or use the special hyphenation command.
In other words: Do you want "quote" and app\-lication\-specific or \enquote{quote} and application"=specific?
Note that this should not happen when the template is generated as the setting tweakouterquote ensures that these two options are mutually exclusive.
The most simple solution to get more space is to exchange the font.
Execute latexindent -l -s -sl -w main-english.tex
Alternatively, execute make format.
See "How can I reformat my .tex files?"
Yes. You can regenerate the template and choose "German" as language.
This template uses the alphabetic style. That style is explained at the biblatex documentation on page 60:
The alphabetic labels resemble a compact author-year style to some extent, but the way they are employed is similar to a numeric citation scheme. For example, instead of “Jones 1995” this style would use the label “[Jon95]”. “Jones and Williams 1986” would be rendered as “[JW86]”.
We are aware that the University of Stuttgart recommends to use the Hardvard style. However, this style is not common in natural sciences and information science.
Install the package dehyph-exptl.
latexmk runs latex, which produces a DVI file (and not a PDF file), because it does not find its configuration.
Make sure that .latexmkrc is in the directory of the document.
Error message:
luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "LatinModernMath-Regular" not found.
luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
! Package fontspec Error: The font "LatinModernMath-Regular" cannot be found.
Install the package lm-math manually.
Install package tugboat.
Install the package libertine manually.
Install the package tex-gyre and tex-gyre-math manually.
See https://tex.stackexchange.com/a/240850/9075: Install the packages newpx and newtxsf manually.
Follow the steps at https://tex.stackexchange.com/a/548335/9075
Try with following command
lualatex -shell-escape --extra-mem-top=10000000 --synctex=1 main-english.texSee https://tex.stackexchange.com/a/124206/9075 for details.
See installation hints of how to update them at different systems.
Use the MiKTeX console to refresh the package index. Then, automatic installation should work again.
- Select the Excel chart you want to use.
- Print to PDF with the option "Print Selected Chart".
- Remove empty space of the created PDF page with
pdfcrop chart.pdf chart_cropped.pdf(install via MikTeX first, if not available; check viapdfcrop --version). - Use pdfscissors to crop the borders and title (maybe you have to allow https://sites.google.com in the Java security center in the control panel).
- Include the PDF in LaTeX via
\includegraphics{chart_cropped.pdf}.
Look for % Code for my fancy chapters. in your main .tex file and play around with parameters.
Sure. The Hagenberg Thesis Document Collection seems to be the most promising. However, they currently do not support microtype and not the cover of the University of Stuttgart.
We are collecting alternatives at the issue #25 and plan to add a comparison to each other template.
- If you included some version control statements, please remove them. Currently, the template does not support any, but it used to support SVN.
- By using
\largepageand\shortpage, single lines at the bottom or at the top of the page can be manually fixed. - Search the PDF for "TODO" or similar things. Remove
\usepackage{todonotes}in your main.texfile. - Ensure that you run
lualatexat least three times and that there are no "undefined references". - The margins are intended for good screen reading. Do not change them (or do exactly know what you are doing).
- Why the templates use which packages: decision records of the template generator
- Other templates: https://latextemplates.github.io/
- For German users, go to https://texfragen.de/.
- Frank Mittelbach with Ulrike Fischer: The LaTeX Companion is the ultimate guide for LaTeX: The authors went through all packages offered by CTAN, selected the most promising ones, described them, and provide minimal working example for each of it.
- Lutz Hering, Heike Hering: How to Write Technical Reports, Springer, 2010; also available in German Technische Berichte - verständlich gliedern, gut gestalten, überzeugend vortragen. - Highly recommended, because it guides through all aspects of a report (such as a Master Thesis).
- Marcus Deininger et al.: Studienarbeiten - Ein Leitfaden zur Erstellung, Durchführung und Präsentation wissenschaftlicher Abschlussarbeiten am Beispiel Informatik, vdf. - Recommended as guideline for planning and working on the whole thesis.
- Charles Lipson, Cite Right, Second Edition: A Quick Guide to Citation Styles--MLA, APA, Chicago, the Sciences, Professions, and More, Chicago Guides to Writing, Editing, and Publishing, 2011. - Recommended in case you are unsure about how to correctly cite something.
The license of this work is 0BSD which corresponds to "public domain". Any derived work can freely be relicensed and can omit original copyright and license information.
The logos are trademarks of the universities: use them only on the title page of a thesis submitted there, so that the thesis is not mistaken for a publication of the university.
figures/uhh-logo.pdfis the logo of the Universität Hamburg, converted from UHH Universität Hamburg Logo mit Schrift 2010 Farbe CMYK.svg (public domain, via Wikimedia Commons).figures/thu-logo.pngis THU Logo Subline deutsch RGB.png by Hochschule Ulm, licensed under CC BY-SA 4.0, via Wikimedia Commons.