Skip to content

Unofficial LaTeX template for a PhD thesis at University of Stuttgart, Germany

License

Notifications You must be signed in to change notification settings

latextemplates/uni-stuttgart-dissertation-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

University of Stuttgart PhD Thesis Template

Unofficial LaTeX template for PhD theses at the University of Stuttgart, Germany.

Example PDFs

Usage

  • thesis-example.tex is the main document
  • Use "lualatex + biblatex" in your TeX editor or latexmk thesis-example / make in the command line

Using latexmk

latexmk is a very smart tool for latex compilation. It executes the latex tools as often as needed to get the final PDF.

To build the whole document, execute following command. Note that this requires a working perl installation.

latexmk thesis-example

To enable latexmk, please move _latexmkrc to latexmkrc.

In case something goes wrong, you can instruct the LaTeX compiler to stop at the first error:

lualatex thesis-example

Advanced usage

On the command line, there are additional features:

  • latexmk -C or make clean for cleaning up
  • make format to reformat the .tex files (one sentence per line and indent)
  • make aspell for interactive spell checking

Benefits

Following features are enabled in this template:

  • Output format is A5
  • Title page
  • Nice chapter headings
  • Important LaTeX packages are enabled
  • (Optional) Typesetting of listings using advanced highlighting powered by the minted package.
  • Generated PDF allows for copy and paste of text without getting words with ligatures such as "workflow" destroyed. This is enabled by glyphtounicode, which encodes ligatures (such as fl) using unicode characters.
  • Support of hyperlinked references without extra color thanx to hyperref.
  • Better breaking of long URLs.
  • Support for \powerset command.
  • 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, cleveref, csquotes, paralist, hyperref, hypcap, upquote, booktabs.
  • LaTeX compilation using the modern lualatex compiler.
  • biblatex+biber instead of plain bibtex to have a more intuitive .bib file.
  • 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.

Disabled features

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.

Tool hints

Prerequisites

Usage of minted

To have minted running properly, you have to do following steps on Windows:

  1. Install python: choco install python - that uses chocolatey to install Python
  2. Install pygments: pip instal pygments - that uses the Pyhton package manager to install the pygments library
  3. When latexing, use -shell-escape: pdflatex -shell-escape thesis-example. You can also just execute latexmk thesis-example.

VSCode configuration

Currently, following extensionsa re recommended:

Then, change the setting of LaTeX Workshop to use biber: Update the following lines in the VSCode settings.json to contain:

    "latex-workshop.latex.recipes": [
        {
            "name": "lualatex ➞ biblatex ➞ lualatex × 2 🔃",
            "tools": [
                "lualatex",
                "biblatex",
                "lualatex",
                "lualatex"
            ]
        },
    ],
    "latex-workshop.latex.tools": [
        ...
        {
            "name": "biblatex",
            "command": "biblatex",
            "args": [
                "%DOCFILE%"
            ],
            "env": {}
        },
        ...
    ],

The following settings are additionally recommended:

{
    "editor.wordWrap": "on",                              # enable soft line breaks
    "latex-workshop.view.pdf.viewer": "tab",              # display the generaded PDF in a separate tab
    "latex-workshop.view.pdf.backgroundColor": "#cccccc", # use a darker background in de PDF viewer to lift of the pages from it
    "latex-workshop.latex.autoBuild.run": "onSave",       # automatically build 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 VSCode settings file.

LTeX+ tips and tricks

LTeX+ is an offline grammar and spell checker with support for LaTeX and Markdown.

Add a magic comment to your files to tell LTeX+ which language to use:

% LTeX: language=de-DE

If you want to use different languages in the text, 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.}

Other hints

Usage with docker

The generated Dockerfile is based on the Dockerfile by the Island of TeX.

docker run --rm -v "c:\users\example\latex-document:/workdir" ltg latexmk

Following one-time setup is required:

docker build -t ltg .

FAQs

Q: How to rename thesis-example.tex?

You probably don't want your document to be named example. In order to change this, replace the term thesis-example by e.g., thesis-topic-name in the following locations:

location occurrence
cover-print/cover.tex \includegraphics{../thesis-example.pdf}
.gitignore thesis-example.pdf
.gitignore thesis-example*.png
Makefile MASTER_TEX = thesis-example.tex

Q: I get the error Reload initiated (formats: otf,ttf,ttc); reason: Font "Inconsolatazi4" not found.

Install package inconsolata

Q: How can I synchronize updates from the template to my repository?

  1. Initialize your git repository as usual
  2. Add this repository as upstream: git remote add upstream https://github.com/latextemplates/{template}.git
  3. Merge the branch upstream/main into your main branch: git merge upstream/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)

Q: I get Package csquotes Error: Unbalanced groups or invalid nesting. What can I do?

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.

Q: I need more space. What can I do?

The most simple solution to get more space is to exchange the font.

Q: How can I reformat my .tex files?

Execute following command:

latexindent -l -s -sl -w thesis-example.tex

Q: I want to obey the one-sentence-per-line rule. How can I do that?

Execute following command:

latexindent -m -l -s -sl -w thesis-example.tex

Attention! This is work in progress and does not always produce best results.

Q: Can I also write in German?

Yes. You can regenerate the template and choose "German" as language.

Q: ngerman-x-latest is reported missing

Install the package dehyph-exptl.

Q: I get ! I can't find file `clmr28t10+20'.

You seem to use latexmk locally. Please move _latexmkrc to latexmkrc to get latexmk working. If you don't do this, latexmk tries to execute latex, which tries to produce a DVI file (and not a PDF file).

Further information