Skip to content

Commit 2ee6723

Browse files
committed
grand-hagenberg-thesis:0.1.0
1 parent 62b812c commit 2ee6723

26 files changed

Lines changed: 1204 additions & 0 deletions
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Tim Peko
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Grand Hagenberg Thesis Template
2+
3+
Opinionated Typst template for bachelor and master theses (and related protocols) at FH Upper Austria, with a focus on Campus Hagenberg.
4+
5+
The template is designed to work in two modes:
6+
7+
- **Fast start via Typst package** for normal usage
8+
- **Full source customization** when you want to adapt sections/styles deeply
9+
10+
## Intent
11+
12+
Typst makes professional-quality publishing simple and accessible for everyone. I believe more people should benefit from its power and ease of use.
13+
14+
I made this template because I couldn’t find a high-quality, flexible FH thesis template. My goal is to help anyone start their thesis with Typst quickly and easily, while also giving advanced users the freedom to customize the template however they need without unnecessary limitations.
15+
16+
Concretely, this template provides a practical, production-ready thesis layout with:
17+
18+
- pre-structured front matter and content flow
19+
- sensible defaults for typography and page layout
20+
- bilingual labels and declarations
21+
- an extensible API for section-level and document-level styling
22+
23+
The package name is `@preview/grand-hagenberg-thesis`.
24+
25+
## Quick Start
26+
27+
### Option A: Use as a Typst package (recommended)
28+
29+
In your Typst document:
30+
31+
```typ
32+
#import "@preview/grand-hagenberg-thesis:0.1.0": full-thesis
33+
```
34+
35+
Then configure metadata and wrap your content with `#show: full-thesis.with(...)` (see `template/main.typ` for a complete example).
36+
37+
You can get started even quicker by using the predefined template:
38+
39+
```bash
40+
typst init @preview/grand-hagenberg-thesis
41+
```
42+
43+
### Option B: Clone and customize this repository
44+
45+
```bash
46+
git clone https://github.com/timerertim/hagenberg-thesis-template.git
47+
cd hagenberg-thesis-template
48+
mise install
49+
```
50+
51+
Build the example template document:
52+
53+
```bash
54+
cd template
55+
mise run export
56+
```
57+
58+
## Styling and Customization
59+
60+
The core template entry point is `full-thesis` in `lib.typ` / `components/template.typ`.
61+
62+
You can customize styling at multiple levels through function hooks, including:
63+
64+
- `global-style` (fonts, page geometry, global defaults)
65+
- `document-style` (document-wide behavior outside title page)
66+
- `content-style` (main chapter content)
67+
- section-specific hooks like `abstract-style`, `outline-style`, `bibliography-style`, etc.
68+
69+
Default style behavior lives in `components/styles.typ` (A4, Arial 11pt, page numbering and heading conventions, bibliography defaults, etc.).
70+
71+
## Language Support
72+
73+
The template currently supports **English (`en`)** and **German (`de`)** through `components/i8n.typ`.
74+
75+
- Set document language with Typst text language, e.g.:
76+
- `#set text(lang: "en")`
77+
- `#set text(lang: "de")`
78+
- Localized section names and declaration page selection are handled automatically.
79+
- If a key is missing, localization falls back to English.
80+
81+
82+
## Setup with `mise.toml`
83+
84+
The repository includes a template project `template/` with its own `mise.toml` that configures:
85+
86+
- tool versions (`typst`, `typstyle`)
87+
- Typst environment paths (`TYPST_ROOT`, font path)
88+
- reusable tasks for formatting and exporting the document
89+
90+
Useful tasks:
91+
92+
- `mise run export` - export the main document to PDF
93+
94+
## Repository Structure
95+
96+
- `lib.typ` - public package entrypoint
97+
- `components/` - template API, sections, i18n, and style defaults
98+
- `template/` - runnable example thesis project
99+
100+
## License
101+
102+
This repository is released under **CC0-1.0** (public domain dedication).
103+
See `LICENSE` for the full legal text.
104+
105+
## Contributing
106+
107+
Issues and pull requests are very welcome.
108+
109+
- Open an issue for bugs, feature requests, or campus-specific adjustments.
110+
- Open a PR for fixes, style improvements, localization updates, and docs improvements.
111+
112+
Feedback from real thesis usage is especially valuable to keep the template robust and practical.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#import "i8n.typ": i8n-date-long
2+
3+
#show heading.where(level: 1): set block(spacing: 2em)
4+
= Erklärung
5+
6+
Ich erkläre eidesstattlich, dass ich die vorliegende Arbeit selbstständig und ohne fremde
7+
Hilfe verfasst, andere als die angegebenen Quellen nicht benutzt und die den benutzten
8+
Quellen entnommenen Stellen als solche gekennzeichnet habe. Die Arbeit wurde bisher in
9+
gleicher oder ähnlicher Form keiner anderen Prüfungsbehörde vorgelegt. Die vorliegende,
10+
gedruckte Arbeit ist mit dem elektronisch übermittelten Textdokument identisch.
11+
12+
Hagenberg, am #i8n-date-long(datetime.today(offset: auto))
13+
14+
#context grid(
15+
columns: (1fr, 1fr),
16+
gutter: 1em,
17+
..document.author.map(author => {
18+
v(2cm)
19+
author
20+
})
21+
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#import "i8n.typ": i8n-date-long
2+
3+
#show heading.where(level: 1): set block(spacing: 2em)
4+
= Declaration
5+
6+
I hereby declare that I have written this thesis independently and without the help of others, have not used any sources other than the ones mentioned, and have marked the quotations from the sources as such. This work has not been submitted to any other examination board in the same or similar form. The printed version of this thesis is identical to the electronically transmitted text document.
7+
8+
Hagenberg, on #i8n-date-long(datetime.today(offset: auto))
9+
10+
#context grid(
11+
columns: (1fr, 1fr),
12+
gutter: 1em,
13+
..document.author.map(author => {
14+
v(2cm)
15+
author
16+
})
17+
)
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
#let keys-to-lang = (
2+
"appendix": (
3+
de: "Anhang",
4+
en: "Appendix",
5+
),
6+
"chapter-outline": (
7+
de: "Inhaltsverzeichnis",
8+
en: "Table of contents",
9+
),
10+
"table-outline": (
11+
de: "Tabellenverzeichnis",
12+
en: "List of tables",
13+
),
14+
"figure-outline": (
15+
de: "Abbildungsverzeichnis",
16+
en: "List of figures",
17+
),
18+
"kurzfassung": (
19+
de: "Kurzfassung",
20+
en: "Kurzfassung",
21+
),
22+
"abstract": (
23+
de: "Abstract",
24+
en: "Abstract",
25+
),
26+
"bibliography": (
27+
de: "Literaturverzeichnis",
28+
en: "Bibliography",
29+
),
30+
"abbreviations": (
31+
de: "Abkürzungsverzeichnis",
32+
en: "List of abbreviations",
33+
),
34+
"acknowledgement": (
35+
de: "Danksagung",
36+
en: "Acknowledgment",
37+
),
38+
"preamble": (
39+
de: "Vorwort",
40+
en: "Preamble",
41+
),
42+
"abbreviation": (
43+
de: "Abkürzung",
44+
en: "Abbreviation",
45+
),
46+
"description": (
47+
de: "Beschreibung",
48+
en: "Description",
49+
),
50+
"course-of-study": (
51+
de: "Studiengang",
52+
en: "Course of study",
53+
),
54+
"schoolyear": (
55+
de: "Schuljahr",
56+
en: "School year",
57+
),
58+
"fh-upper-austria": (
59+
de: "Fachhochschule Oberösterreich",
60+
en: "University of Applied Sciences Upper Austria",
61+
),
62+
"campus-hagenberg": (
63+
de: "Campus Hagenberg",
64+
en: "Campus Hagenberg",
65+
),
66+
"date": (
67+
de: "Datum",
68+
en: "Date",
69+
),
70+
"mentor": (
71+
de: "Betreuer",
72+
en: "Mentor",
73+
),
74+
"executed-by": (
75+
de: "Ausgeführt von",
76+
en: "Executed by",
77+
),
78+
"submission-notes": (
79+
de: "Abgabevermerk",
80+
en: "Submission notes",
81+
),
82+
"master-thesis": (
83+
de: "Masterarbeit",
84+
en: "Master thesis",
85+
),
86+
"bachelor-thesis": (
87+
de: "Bachelorarbeit",
88+
en: "Bachelor thesis",
89+
),
90+
"total-project": (
91+
de: "Gesamtprojekt",
92+
en: "Total project",
93+
),
94+
"on-date": (
95+
de: "am",
96+
en: "on",
97+
),
98+
)
99+
100+
#let i8n(key) = context {
101+
let lang = text.lang
102+
let translations = keys-to-lang.at(key)
103+
let value = translations.at(lang, default: translations.at("en"))
104+
value
105+
}
106+
107+
#let i8n-declaration-page() = context {
108+
let lang = text.lang
109+
if lang == "de" {
110+
include "declaration_de.typ"
111+
} else {
112+
include "declaration_en.typ"
113+
}
114+
}
115+
116+
#let i8n-page-counter(current, total, numbering: auto) = context {
117+
let lang = text.lang
118+
let numbering = page.numbering
119+
let numbering = if numbering == auto or numbering == none { "1" } else {
120+
numbering
121+
}
122+
if lang == "de" [
123+
#std.numbering(numbering, current)
124+
] else [
125+
#std.numbering(numbering, current)
126+
]
127+
}
128+
129+
#let i8n-date-short(date) = context {
130+
let lang = text.lang
131+
if lang == "de" [
132+
#date.display("[day].[month].[year]")
133+
] else [
134+
#date.display("[year]-[month]-[day]")
135+
]
136+
}
137+
138+
#let i8n-date-long(date) = context {
139+
let lang = text.lang
140+
if lang == "de" [
141+
// Currently does not support localization for month repr:long, so we use a fixed format.
142+
#date.display("[day].[month].[year]")
143+
] else [
144+
#date.display("[month repr:long] [day], [year]")
145+
]
146+
}

0 commit comments

Comments
 (0)