This commit is contained in:
Gaspard Jankowiak 2026-05-12 10:03:39 +02:00
commit 2bca935b19
5 changed files with 179 additions and 0 deletions

27
README.md Normal file
View file

@ -0,0 +1,27 @@
# Typst unofficial KFU letter template
![thumbnail](thumbnail.png)
## Installation (Linux only)
#### Using [`typship`](https://github.com/sjfhsjfh/typship)
```bash
typship download -n local https://imsc.uni-graz.at/git/gjankowiak/typst-kfu-letter
```
#### Manually
```bash
mkdir -p ~/.local/share/typst/packages/local/kfu-letter/
cd ~/.local/share/typst/packages/local/kfu-letter/
curl https://imsc.uni-graz.at/git/gjankowiak/typst-kfu-letter/archive/0.1.0.tar.gz | tar zx --xform 's/typst-kfu-letter/0.1.0/'
```
## Quickstart (CLI)
```sh
typst init @local/kfu-letter letter
```
Tested typst version: `0.14.2`.

92
src/lib.typ Normal file
View file

@ -0,0 +1,92 @@
#let letter(
lang: "de",
place: "Graz",
date: "01. April 1970",
title: "Dr.",
firstname: "John",
lastname: "Doe",
departement: [Institut für Mathematik und Wissenschaftliches Rechnen],
address: "Heinrichstraße 36, 8010 Graz",
phone: 1234,
homepage: "https://imsc.uni-graz.at/doe",
subject: [Der Betreff eines Schreibens sollte in einer Zeile gut Platz finden.],
signature: none,
body:none,
firstpage
) = [
#set text(font:"Nunito Sans", lang: lang)
#let email = [#firstname.#lastname\@uni-graz.at]
#let signature_block = [
#if signature != none {
signature
} else [
#v(2em)
Mit freundlichen Grüßen
#title #firstname #lastname
]
]
#let senderinfo = align(right)[
#set text(8pt)
*Universität Graz* \
*#departement* \
#title #firstname #lastname \
#address \
+43 (0)316 / 380-#phone | #email \
#homepage]
#set page(
margin: (bottom: 5.23cm),
footer: [
#set text(8pt)
#grid(columns:(auto, 1fr, auto),
align(bottom)[#context{ counter(page).display("1/1", both: true) }],
[],
senderinfo)
])
#page(
margin: auto,
footer: context {
set text(8pt)
if counter(page).final().at(0) > 1 { counter(page).display("1/1", both: true) }
})[#align(right)[#image("logos/kfulogo_claim.pdf", height: 2cm)]
Name/Institution \
Abteilung \
Titel Vorname Nachnamen \
Adresse \
PLZ Ort
#senderinfo
#align(right)[#place, #date]
*#subject*
#firstpage
#if body == none [
#signature_block
]
]
#if body != none [
#body
#signature_block
]
]

BIN
src/logos/kfulogo_claim.pdf Normal file

Binary file not shown.

38
template/letter.typ Normal file
View file

@ -0,0 +1,38 @@
#import "@local/kfu-letter:0.1.0": letter
#letter(
lang: "de",
place: "Graz",
date: "01. April 1970",
title: "Dr.",
firstname: "John",
lastname: "Doe",
departement: [Institut für Mathematik und Wissenschaftliches Rechnen],
address: "Heinrichstraße 36, 8010 Graz",
phone: 1234,
homepage: "https://imsc.uni-graz.at/doe",
subject: [Der Betreff eines Schreibens sollte in einer Zeile gut Platz finden.],
signature: none,
signature_filename: none,
signature_width: 4cm,
)[
signature_filename: "signature.png",
[
This is the letter' first page's body.
], body: [
#lorem(200)
#lorem(200)
]]

22
typst.toml Normal file
View file

@ -0,0 +1,22 @@
[package]
name = "kfu-letter"
version = "0.1.0"
entrypoint = "src/lib.typ"
authors = ["Gaspard Jankowiak"]
description = "Unofficial Typst letter template, roughly following corporate design"
homepage = "https://imsc.uni-graz.at/gjankowiak/typst-kfu-letter"
repository = "https://imsc.uni-graz.at/gjankowiak/typst-kfu-letter"
keywords = [""]
categories = [
"layout",
"text",
"utility",
"office",
]
compiler = "0.14.2"
[template]
path = "template"
entrypoint = "template/letter.typ"
[tool]