Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7cbc174
chore: init 0.3.0 dir
stanlrt Apr 15, 2026
91131e7
feat: none handling for options
stanlrt Apr 15, 2026
7a223d0
fix: aknow supervisors bug
stanlrt Apr 15, 2026
8f7df12
fix: minor permalink warning
stanlrt Apr 15, 2026
0e31f07
fix: https://github.com/typst/packages/pull/4591#discussion_r3088897703
stanlrt Apr 17, 2026
f7e0910
fix: https://github.com/typst/packages/pull/4591#discussion_r3088897826
stanlrt Apr 17, 2026
34d6e55
fix: https://github.com/typst/packages/pull/4591#discussion_r3088897929
stanlrt Apr 17, 2026
478d049
fix: https://github.com/typst/packages/pull/4591#discussion_r3088897904
stanlrt Apr 17, 2026
c2ccc80
fix: https://github.com/typst/packages/pull/4591#discussion_r3088897843
stanlrt Apr 17, 2026
a6469df
fix: https://github.com/typst/packages/pull/4591#discussion_r3088897869
stanlrt Apr 17, 2026
44f683e
fix: https://github.com/typst/packages/pull/4591#discussion_r3088897982
stanlrt Apr 17, 2026
ded4cfc
fix: https://github.com/typst/packages/pull/4591#discussion_r3088898060
stanlrt Apr 17, 2026
6f44c4b
fix: https://github.com/typst/packages/pull/4591#discussion_r3088898011
stanlrt Apr 17, 2026
7126b75
fix: copilot comments
stanlrt Apr 17, 2026
4569e2a
fix: long H1s overlapping with next section
stanlrt Apr 18, 2026
c672e53
feat(0.4.0): init
stanlrt Apr 22, 2026
be312de
feat: remove glossy patch and
stanlrt Apr 22, 2026
58d727a
feat: adjust h1 sizes based on feedback
stanlrt Apr 22, 2026
58c53bb
Merge branch 'typst:main' into modern-zhaw-thesis-0.4.0
stanlrt Apr 22, 2026
5f90235
feat: fruther heading tweak
stanlrt Apr 22, 2026
47562d8
feat: further heading tweak 2
stanlrt Apr 22, 2026
96700d3
feat: page header ellispsing
stanlrt Apr 22, 2026
5168a58
chore: update showcase pdf
stanlrt Apr 23, 2026
d74e426
revert: gitignore file
stanlrt Apr 23, 2026
c63afac
docs: indicate breaking change
stanlrt Apr 25, 2026
b019417
docs: ichangelog on pkg page
stanlrt Apr 25, 2026
14ce1d6
feat!: native bibliography function
stanlrt Apr 26, 2026
ee8466c
docs: improve biblio docu
stanlrt Apr 26, 2026
ba90872
docs: link to docs
stanlrt Apr 26, 2026
3d2ca50
Merge branch 'modern-zhaw-thesis-0.4.0' of https://github.com/stanlrt…
stanlrt Apr 26, 2026
256fba8
feat!: preset feature (hide-frontmatter gone)
stanlrt Apr 26, 2026
111c436
docs: better desc
stanlrt Apr 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions packages/preview/modern-zhaw-thesis/0.4.0/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Changelog

## 0.4.0

- **BREAKING (layout shifts)**: Tweaked H1 font size and spacing based on feedback
- **BREAKING**: `biblio: (file:, style:)` replaced by `bibliography:` — pass a `bibliography()` object directly
- **BREAKING**: `hide-frontmatter` replaced by `preset` — use `preset: "draft"` for equivalent behaviour
- Added `preset` parameter: `"thesis"` (default, show everything), `"draft"` (hide all frontmatter), `"exercise"` (show cover page + TOC, hide abstract/acknowledgements/declaration)
- Replaced custom Glossy patch with official 0.9.1 release. Should not be a breaking change.

## 0.3.0

- Allow setting overrideable options to `none`
- Fixed edge cases when some options were set to `none` and caused errors
- Fixed declaration of originality appendix ref
- Fixed bug displaying supervisor names in acknowledgements page
- Fixed localisation of "Chapter" label in page header
- Fixed long H1s overlapping with next section

## 0.2.0

- Added custom quote styling
- Fixed glossary issues when no entries are provided
- Localised outline and appendix headings
- Fixed Glossy init-glossary validation bug
- Fixed empty optional supervisor fields
- Fixed translation strings
- Fixed custom declaration of originality body rendering
- Fixed README typos

## 0.1.1

Improved README

## 0.1.0

Initial release
17 changes: 17 additions & 0 deletions packages/preview/modern-zhaw-thesis/0.4.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
MIT-0 (MIT No Attribution License)
Copyright (c) 2026 Stanislas Laurent

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
182 changes: 182 additions & 0 deletions packages/preview/modern-zhaw-thesis/0.4.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
# `modern-zhaw-thesis` template

`modern-zhaw-thesis` is a comprehensive template for ZHAW academic works (theses, exercises, reports...), adapted from the official branding and following official requirements. It supports both English and German.

[Here's a showcase](./showcase.pdf) of how it looks like.
Comment thread
stanlrt marked this conversation as resolved.

## Setup

1. Download the font files from the repo's font directory:

[GitHub](https://github.com/stanlrt/typst-zhaw-thesis/tree/28927077165d31305c4438657eb0cdefa32bbcbd/fonts)

[Direct download](https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2Fstanlrt%2Ftypst-zhaw-thesis%2Ftree%2F28927077165d31305c4438657eb0cdefa32bbcbd%2Ffonts)

### Web-app (easiest)

2. [Create a project using the template](https://typst.app/app?template=modern-zhaw-thesis&version=0.4.0)
3. In the left sidebar, under "Files", create a folder called `fonts`
4. Drag and drop the files into this `fonts` directory

### Local

2. Install Typst from https://typst.app/open-source/
3. Make the downloaded fonts accessible to the compiler (https://typst.app/docs/reference/text/text/#parameters-font)
4. Run `typst init @preview/modern-zhaw-thesis:0.4.0` in your project directory

## All configuration options

Below is the complete list of configuration options, including default values and explanations. Most are optional.

```typ
#import "@preview/modern-zhaw-thesis:0.4.0": zhaw-thesis, languages

// Note: `override` options accept Typst files (`override: [#include "my-override.typ"]`), and `none`

#show: zhaw-thesis.with(
language: languages.de, // Document language
preset: "thesis", // "thesis": show everything (default)
// "draft": hide all frontmatter (to focus on writing)
// "exercise": show cover+TOC (no abstract/acks./declaration)

cover: (
school: none, // E.g., "School of Engineering" REQUIRED
institute: none, // E.g., "Computer Science" REQUIRED
work-type: none, // E.g., "Bachelor Thesis" REQUIRED
title: none, // Work's title REQUIRED
authors: none, // Author name(s), e.g. ("Max Muster", "Erika Muster") REQUIRED
supervisors: none, // Supervisor name(s), two formats:
// 1. Simple: `("Prof. Dr. John Doe", "Dr. Jane Doe")`
// 2. Categorised: `(main: "Prof. Dr. John Doe",
// secondary: "Dr. Jane Doe", external: "Dr. External")`
industry-partner: none, // Industry partner name, e.g. "Schweizer AG"
study-program: none, // E.g., "Computer Science BSc"
override: none, // Override the cover page with your own file
),

abstract: (
keywords: none, // List of keywords, e.g. `("machine learning")` REQUIRED
en: none, // English abstract text
de: none, // German abstract text. REQUIRED by ZHAW even when lang is English.
override: none, // Override the abstract page with your own file
),

acknowledgements: (
text: none, // Custom acknowledgements text
override: none, // Override the acknowledgements page with your own file
),

declaration-of-originality: (
location: none, // E.g., "Zurich" REQUIRED
text: none, // Custom declaration text
override: none, // Override the declaration page with your own file
),

bibliography: none, // bibliography() object
// e.g. `bibliography("refs.bib", style: "ieee")` (see Typst's docs)

glossary-entries: none, // Variable containing glossary entries (see template)
appendix: none, // Appendix Typst file, e.g. [#include "appendix.typ"]
page-border: true, // Enable/disable page border
print-mode: false, // Gives a white background to the cover page to reduce ink usage
)
```

## Exported symbols

The package exports the following symbols for you to use if needed:

```typ
#import "@preview/modern-zhaw-thesis:0.4.0": (
zhaw-thesis, // Main template function, see docu above
callout, // Coloured callout box to highlight important text

centered, // Vertically centred layout
today, // Current date in local format
languages, // Available languages
push-lang, // Set new language (see docu below)
pop-lang, // Switch back to previous language (see docu below)
)
```

You can refer to the [demo document](./template/main.typ) for usage examples.

## Configuration of dependencies

### Glossary

The template uses the [Glossy package](https://typst.app/universe/package/glossy/) to power the glossary feature under the hood.
You can find instructions about how to use all its options directly on the [package page](https://typst.app/universe/package/glossy/).

### Code blocks

The template uses the [Codly package](https://typst.app/universe/package/codly/) to style code snippets.
You can find instructions about how to use all its options in [its PDF manual](https://github.com/Dherse/codly/blob/ece8099b46cd899ea99a835ebd78c57ef2dd0b74/docs.pdf).

### Multi-linguism

Should you need use different languages for different pages of your work, you can refer to [Tieflang's documentation](https://typst.app/universe/package/tieflang/).
Comment thread
stanlrt marked this conversation as resolved.

## Feature requests & problems

Feel free to [request features or report problems here](https://github.com/stanlrt/typst-zhaw-thesis/issues)

## License and Trademark Notice

### Software License

The Typst code and template structure in this package are licensed under the **MIT-0 License** (MIT No Attribution). See the [LICENSE](LICENSE) file for details.

### ZHAW Logo and Trademark

**Important:** The ZHAW logo and trademark included in this package are **NOT** covered by the MIT-0 license.

- **Trademark Owner:** The ZHAW logo and brand are the exclusive property of Zürcher Hochschule für Angewandte Wissenschaften (ZHAW).
- **Rights:** Users of this package do **not** receive any rights to sublicense, sell, or redistribute the ZHAW logo under the MIT-0 license terms.
- **Usage:** The logo is included for the specific purpose of creating ZHAW-compliant academic documents. Any other use requires permission from ZHAW.

As specified in section 2.b.2 of Creative Commons and similar public licenses: **"The trademark ZHAW is not affected by the license. Patent and trademark rights are not licensed under this Public License."**

For information about ZHAW's branding guidelines, refer to the official [ZHAW trademark guidelines for open educational resources](https://gpmpublic.zhaw.ch/GPMDocProdDPublic/Vorgabedokumente_ZHAW/Z_MB_Merkblatt_CC_Lizenzen_von_OER.pdf).

### Unofficial Template Notice

This is an **unofficial** template created by a student. It is not endorsed, maintained, or supported by ZHAW. The template attempts to follow official ZHAW branding guidelines and academic requirements, but users should verify compliance with current university standards.

## Changelog

### 0.4.0

- **BREAKING (layout shifts)**: Tweaked H1 font size and spacing based on feedback
- **BREAKING**: `biblio: (file:, style:)` replaced by `bibliography:` — pass a `bibliography()` object directly (refer to [Typst's docs](https://typst.app/docs/reference/model/bibliography/))
- **BREAKING**: `hide-frontmatter` replaced by `preset` — use `preset: "draft"` for equivalent behaviour
- Added `preset` parameter: `"thesis"` (default, show everything), `"draft"` (hide all frontmatter), `"exercise"` (show cover page + TOC, hide abstract/acknowledgements/declaration)
- Replaced custom Glossy patch with official 0.9.1 release. Should not be a breaking change.

### 0.3.0

- Allow setting overrideable options to `none`
- Fixed edge cases when some options were set to `none` and caused errors
- Fixed declaration of originality appendix ref
- Fixed bug displaying supervisor names in acknowledgements page
- Fixed localisation of "Chapter" label in page header
- Fixed long H1s overlapping with next section

### 0.2.0

- Added custom quote styling
- Fixed glossary issues when no entries are provided
- Localised outline and appendix headings
- Fixed Glossy init-glossary validation bug
- Fixed empty optional supervisor fields
- Fixed translation strings
- Fixed custom declaration of originality body rendering
- Fixed README typos

### 0.1.1

Improved README

### 0.1.0

Initial release
4 changes: 4 additions & 0 deletions packages/preview/modern-zhaw-thesis/0.4.0/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#import "src/zhaw-thesis.typ": callout, zhaw-thesis
#import "src/styling/tokens.typ": tokens
#import "src/utils.typ": centered, today
#import "src/translations.typ": languages, pop-lang, push-lang
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions packages/preview/modern-zhaw-thesis/0.4.0/src/frontmatter.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#import "pages/title.typ": title-page
#import "pages/abstract.typ": abstract-page
#import "pages/acknowledgements.typ": acknowledgements-page
#import "pages/originality.typ": declaration-of-originality-page

#let zhaw-cover-page(cover, print-mode: false) = {
if cover == none {
return
}
if cover.override != none {
cover.override
} else {
title-page(
school: cover.school,
institute: cover.institute,
work_type: cover.work-type,
title: cover.title,
authors: cover.authors,
supervisors: cover.supervisors,
co-supervisors: cover.co-supervisors,
industry-partner: cover.industry-partner,
print-mode: print-mode,
)
}
}

#let zhaw-abstract-section(abstract, cover) = {
if abstract == none {
return
}
if abstract.override != none {
abstract.override
} else {
if cover == none {
panic(
"`cover` metadata is required when the abstract section is included. Set `abstract: none` to omit the section, or provide a `cover` dictionary.",
)
}
if abstract.de == none {
panic("ZHAW requires a German abstract even for English works.")
}
abstract-page(
en: abstract.en,
de: abstract.de,
keywords: abstract.keywords,
authors: cover.authors,
title: cover.title,
)
}
}

#let zhaw-acknowledgements-section(acknowledgements, cover) = {
if acknowledgements == none {
return
}
if acknowledgements.override != none {
acknowledgements.override
} else {
if cover == none {
panic(
"`cover` metadata is required when the acknowledgements section is included. Set `acknowledgements: none` to omit the section, or provide a `cover` dictionary.",
)
}
acknowledgements-page(
acknowledgements: acknowledgements.text,
supervisors: cover.supervisors,
co-supervisors: cover.co-supervisors,
authors: cover.authors,
)
}
}

#let zhaw-declaration-section(declaration-of-originality, cover) = {
if declaration-of-originality == none {
return
}
if declaration-of-originality.override != none {
declaration-of-originality.override
} else {
if cover == none {
panic(
"`cover` metadata is required when the declaration of originality section is included. Set `declaration-of-originality: none` to omit the section, or provide a `cover` dictionary.",
)
}
declaration-of-originality-page(
declaration_of_originality: declaration-of-originality.text,
location: declaration-of-originality.location,
authors: cover.authors,
)
}
}
50 changes: 50 additions & 0 deletions packages/preview/modern-zhaw-thesis/0.4.0/src/pages/abstract.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#import "../utils.typ": centered, ensure-array, today
#import "@preview/tieflang:0.1.0": pop-lang, push-lang, tr

#let render-abstract(lang-code, abstract-text, keywords, authors, title) = context {
push-lang(lang-code)

show: doc => centered(tr().abstract, doc)
show grid.cell.where(x: 0): set text(weight: "bold")

let authors = ensure-array(authors)
let keywords = ensure-array(keywords)

grid(
columns: (2cm, 1fr),
column-gutter: 0.4cm,
row-gutter: 0.3cm,
tr().title, title,
(tr().author)(authors.len()), authors.join(", "),
tr().date, today(),
tr().institution, tr().institution_name,
)

v(0.5cm)
abstract-text
v(0.5cm)

grid(
columns: (auto, 1fr),
column-gutter: 0.4cm,
row-gutter: 0.3cm,
tr().keywords, keywords.join(", "),
)

pop-lang()
}

#let abstract-page(
en: none,
de: none,
keywords: none,
authors: none,
title: none,
) = {
if en != none {
render-abstract("en", en, keywords, authors, title)
}
if de != none {
render-abstract("de", de, keywords, authors, title)
}
}
Loading
Loading