A comprehensive LaTeX template for student writing at HTW Dresden, with extensive examples of commonly used LaTeX features. It produces two kinds of document — a Thesis (bachelor's, master's or dissertation) and a Praktikumsbericht (module I190 Praxisprojekt) — from one shared set of content files.
- Complete thesis structure with all standard sections
- Extensive LaTeX examples organized from basic to advanced
- Modern LaTeX setup using XeLaTeX/LuaLaTeX with polyglossia
- Professional typography with microtype and fontspec
- Code highlighting with minted package
- Smart references using cleveref
- Bibliography management with biblatex/biber
- Data visualization with PGFPlots
- Algorithm pseudocode support
- Acronym and glossary management
- LaTeX distribution (TeX Live, MiKTeX, or MacTeX)
- XeLaTeX or LuaLaTeX compiler
- Python with Pygments installed (for code highlighting)
- Biber (usually included with LaTeX distribution)
Compile the root file that matches the kind of document you are writing —
thesis.tex for a Thesis, praktikumsbericht.tex for a Praktikumsbericht
(module I190). Both share the same content files; the variant follows from
which root file you compile, so there is no setting to change.
# Recommended: latexmk picks up .latexmkrc (LuaLaTeX with -shell-escape)
latexmk thesis.tex
latexmk praktikumsbericht.tex
# Explicit engine selection, if you are not using .latexmkrc
latexmk -lualatex -shell-escape thesis.tex
# Clean auxiliary files
latexmk -cNote: The -shell-escape flag is required for the minted package to work properly.
thesis-template/
├── thesis.tex # Root file for the Thesis variant
├── praktikumsbericht.tex # Root file for the Praktikumsbericht variant
├── literature.bib # Bibliography
├── sections/ # Chapters, one directory per variant
│ ├── thesis/
│ │ ├── 01_introduction.tex # Introduction template
│ │ └── 02_examples.tex # Comprehensive LaTeX examples
│ └── praktikumsbericht/ # The five recommended chapters, with Leitfragen
│ ├── 01_introduction.tex
│ ├── 02_placement.tex
│ ├── 03_main_part.tex
│ ├── 04_reflection.tex
│ └── 05_conclusion.tex
├── content/
│ ├── abstract.tex # Abstract
│ ├── acknowledgements.tex
│ ├── images/ # Image files
│ ├── scripts/ # Code examples
│ └── figures/ # PGFPlots definitions
├── metadata/
│ ├── cover_page.tex # Title page
│ ├── sperrvermerk.tex # Confidentiality notice, optional
│ ├── declaration.tex # Declaration of authorship
│ ├── ai_declaration.tex # Declaration on the use of AI-based tools
│ ├── acronyms.tex # Acronym definitions
│ ├── glossary.tex # Glossary terms
│ ├── meta.tex # Document metadata, the language switch and the lists
│ ├── packages.tex # Package imports
│ └── lang/ # Shipped text, per language
│ ├── strings_de.tex # Labels, document types, placeholders (German)
│ ├── strings_en.tex # ... and English
│ ├── declaration_*.tex # Prose of the declaration of authorship
│ ├── ai_declaration_*.tex # Prose and example rows of the AI declaration
│ ├── sperrvermerk_*.tex # Prose of the Sperrvermerk, one per case
│ └── taetigkeitsnachweis_*.tex # Table and example rows of the record
├── appendix/
│ ├── 01_dummy.tex # Example appendix
│ └── taetigkeitsnachweis.tex # Week-by-week record of the placement, optional
└── tools/
├── check_language_tables.sh # Both string tables define the same labels
└── build_matrix.sh # Builds both variants in both languages
The template includes practical examples of:
- Lists and Enumerations - Nested lists, custom styles, inline lists
- Cross-References - Smart references with cleveref
- Images - Including, scaling, and transforming images
- Tables - Professional tables with booktabs
- Mathematical Equations - Inline and display math
- Subfigures - Side-by-side image comparisons
- Data Visualization - Charts with PGFPlots
- Code Listings - Syntax-highlighted code with minted
- Algorithm Pseudocode - Formatted algorithms
- Bibliography Citations - Reference management
- Footnotes - Various footnote styles
- Acronyms - Automatic acronym expansion
Every placeholder is defined in metadata/meta.tex — edit that file first. The
values it ships with are language-dependent placeholders (\phTitel and friends)
taken from the string table; overwrite them with your own text.
| Macro | Meaning |
|---|---|
\art |
Document type — pick \artBachelor, \artMaster or \artDissertation. Thesis only; a Praktikumsbericht takes its type from the root file |
\titel |
Document title |
\fachgebiet |
Field of study |
\autor |
Your full name |
\matrikelnr |
Your student ID / matriculation number |
\studentEmail |
Your email address |
\universityName |
Name of your university |
\studienbereich |
Faculty / department |
\ort |
Location |
\erstgutachter |
First examiner — Thesis only |
\zweitgutachter |
Second examiner — Thesis only |
\partnerorganisation |
Company, authority or institution you wrote the work with — also the Praktikumsstelle |
\betrieblichebetreuung |
Workplace supervision — Praktikumsbericht only |
\praktikumszeitraum |
Placement period — Praktikumsbericht only |
\hochschulbetreuung |
Supervising lecturer at your university — Praktikumsbericht only |
\abgabedatum |
Submission date (DD.MM.YYYY) |
\jahr |
Year |
\semester |
Semester (e.g. Winter Semester 2024/2025) |
\vertraulicheteile |
The confidential parts — only used by a partial Sperrvermerk (see below) |
\sperrfrist |
Period of confidentiality in years — empty means unlimited (see below) |
Chapters live in sections/, one directory per variant — sections/thesis/ and
sections/praktikumsbericht/. Your root file inputs only its own, so you can
delete the other directory once you have taken what you want from it.
- Replace content in
sections/thesis/01_introduction.texwith your introduction, or fill in the five chapters ofsections/praktikumsbericht/ - Use examples from
sections/thesis/02_examples.texas templates — they are worth a look whichever variant you are writing - Add your bibliography entries to
literature.bib - Update
content/abstract.texwith your abstract, or, in a Praktikumsbericht, with your Zusammenfassung — it is the same slot, and the heading follows the variant
Add or remove chapters by editing the \input{} and \include{} lines in the
root file you compile. Additional packages belong in metadata/packages.tex.
Language is an axis of its own: every variant exists in German and in English.
One switch at the top of metadata/meta.tex selects it.
\newif\ifgerman
\germanfalse % \germantrue for a German documentThe switch drives polyglossia's default language and every text the template ships — cover page, headings of the lists, both declarations. It is independent of the root file, so all four combinations (Thesis and Praktikumsbericht, German and English) work. Your own text is not translated; write it in the language you picked.
Shipped text lives in metadata/lang/, split by kind:
- String tables (
strings_de.tex,strings_en.tex) hold the labels as macros — cover-page field names, headings of the lists, document types and the placeholder defaults used inmetadata/meta.tex. Adding a label means adding it to both files;tools/check_language_tables.shreports any that is missing, andtools/build_matrix.shbuilds both variants in both languages to check that they still come out. - Prose files (
declaration_*.tex,ai_declaration_*.tex) hold the multi-sentence blocks, so they stay readable and can be proofread.\inputlang{name}pulls in whichever ofname_de.tex/name_en.texthe switch selects.
The example content — sections, abstract, acknowledgements, the acronym and glossary entries, the appendix — is not translated. It is there to be replaced.
German text ships without Sonderformen for gendering — see
docs/adr/0002-german-language-conventions.md.
Six lists can stand ahead of your text — contents, figures, tables, listings, acronyms and glossary. Each has a switch of its own, and the root file you compile sets the ones its variant wants:
| Variant | Prints by default |
|---|---|
| Thesis | all six |
| Praktikumsbericht | contents and acronyms |
A Praktikumsbericht of twenty pages would otherwise open with four near-empty pages. The acronyms stay on for both, because a placement cites tooling and in-house abbreviations as readily as a Thesis does, and the list only holds what your text actually used.
To depart from the default, add the switch you want to metadata/meta.tex —
that file is read after the root file's defaults, so what you set there wins.
A commented-out line per list is waiting there; uncomment it to switch a list
off, or write the ...true form to switch one on:
\listoffigurestrue % a Praktikumsbericht with figures worth listing
\glossaryfalse % a Thesis without a glossarySwitching a list off takes its page and its entry in the table of contents with
it, and leaves nothing behind — no heading, no blank page, no gap in the page
numbers. The entries stay usable either way: \ac{...} and \gls{...} in your
text go on working with no list in front of them, so you can drop the list
without touching the text. An \ac{...} then stops being a hyperlink, because
the target it would link to is the entry in the list you just dropped.
The acronyms list is the one that starts out empty: it holds the acronyms your
text actually used, and a Praktikumsbericht whose chapters you have not written
yet has used none. It fills as you write. If your document genuinely has no
acronyms, \acronymsfalse takes the page away.
Compile praktikumsbericht.tex. Nothing else has to be switched: the cover page
drops the two examiners and prints the placement instead — Praktikumsstelle,
Betriebliche Betreuung, Praktikumszeitraum, Betreuung durch die Hochschule — and
names the module under the document type. The Praktikumsstelle comes from
\partnerorganisation, the same field the Sperrvermerk uses; the other three
fields sit next to it in metadata/meta.tex.
The body is five chapters in sections/praktikumsbericht/:
Zusammenfassung (content/abstract.tex, at most one page, unnumbered)
1 Einleitung
2 Praktikumsstelle und Einsatzumfeld
3 Hauptteil (Aufgabe -> Problem -> Lösung)
4 Reflexion
5 Fazit
This is a recommendation, not a rule. Neither the Praktikumsordnung nor the
module description prescribes a structure, so agree yours with your supervisor
and edit the \input lines in praktikumsbericht.tex. Each chapter file opens
with Leitfragen as comments — what belongs in that chapter, in German and
English. The Reflexion chapter has the most of them, because it is the chapter a
Thesis has no counterpart for.
The Tätigkeitsnachweis, the week-by-week record of the placement, is an appendix
you can switch off in metadata/meta.tex:
\newif\iftaetigkeitsnachweis
\taetigkeitsnachweistrue % false: the appendix is not printed at allIt ships as a table with two example rows in
metadata/lang/taetigkeitsnachweis_de.tex / _en.tex. Replace them with your
own weeks and add as many rows as you need; the table breaks across pages and
repeats its header.
If your partner organisation requires a Sperrvermerk, switch it on in
metadata/meta.tex. It is off by default, and off it prints nothing at all. Like
the language, it is independent of the variant — a Thesis written with a company
partner needs one as often as a Praktikumsbericht does.
\newif\ifsperrvermerk
\sperrvermerktrue % the template ships \sperrvermerkfalse
\newif\ifsperrvermerkteilweise
\sperrvermerkteilweisefalse % true: only \vertraulicheteile are confidential
\newcommand{\vertraulicheteile}{Chapter 4 and Appendix B}
\newcommand{\sperrfrist}{5} % years — leave empty for unlimitedThe notice is printed directly after the cover page, unnumbered and not listed in
the table of contents. It names \partnerorganisation, the one field for the
organisation you wrote the work with — the Praktikumsbericht's Praktikumsstelle
is to come from the same field, so it stays filled in once.
Two things parameterise it, and all four combinations render correct text:
- Scope — the whole work is confidential (
\sperrvermerkteilweisefalse), or only the parts you name in\vertraulicheteile(\sperrvermerkteilweisetrue). In the whole-work case\vertraulicheteileis ignored. - Duration —
\sperrfristholds the number of years your contract states. Leave it empty (\newcommand{\sperrfrist}{}) and the notice says the confidentiality is not limited in time. Give years rather than an end date: a date computed from the submission date is wrong as soon as the submission slips.
The shipped text is a marked specimen, not binding wording. It is labelled
[Musterformulierung] / [Specimen wording] in the output, and a smaller note
under the notice repeats that and says where the binding version comes from.
What binds is the notice agreed with your partner organisation, and nothing
else — no faculty-wide specimen exists. In a Praktikumsvertrag following Anlage
1 of the Praktikumsordnung, such an agreement belongs in § 10 Sonstige
Vereinbarungen, which keeps space for it but supplies no wording. Compare the
shipped text with your agreement and replace the wording in
metadata/lang/sperrvermerk_de.tex or
sperrvermerk_en.tex — each of the four cases is written out in full there —
then drop the marker and delete the \musterhinweis{…} block at the foot of the
same file.
The specimen keeps to the generic core of a Sperrvermerk: whose information it is, what may not be done with it, and for how long. It says nothing about the examination procedure or any other point only your contract can settle.
If you get OpenSans font errors, the font requirement is already commented out in metadata/packages.tex.
Ensure you're using the -shell-escape flag when compiling.
Run the compilation twice or use latexmk for automatic dependency handling.
Cross-references need two compilation passes to resolve. latexmk handles this
for you; if you invoke the engine by hand, run it again.
Write mathematical symbols in maths mode rather than as literal characters —
$\beta$ instead of β, $\chi^2$ instead of χ². Literal Unicode is fine in
running text, since the template compiles with LuaLaTeX and fontspec.
- XeLaTeX or LuaLaTeX (required for fontspec/polyglossia)
- Python with Pygments (for minted code highlighting)
- Biber (for bibliography processing)
- latexmk (recommended for automated compilation)
- Start with the examples - Review
sections/02_examples.texto learn LaTeX features - Use the logical order - Examples progress from basic to advanced
- Copy and adapt - Use example code as templates for your content
- Compile frequently - Check your changes compile correctly
- Use version control - Track your thesis with Git
This template is provided as-is for academic use. Feel free to modify and adapt it for your thesis.
Improvements and bug fixes are welcome. Please submit issues or pull requests on the project repository.