commit 2bca935b19969ce3ef5fe5bdca8f857a2b857321 Author: Gaspard Jankowiak Date: Tue May 12 10:03:39 2026 +0200 import diff --git a/README.md b/README.md new file mode 100644 index 0000000..cd45fa1 --- /dev/null +++ b/README.md @@ -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`. diff --git a/src/lib.typ b/src/lib.typ new file mode 100644 index 0000000..39ec0f7 --- /dev/null +++ b/src/lib.typ @@ -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 +] +] diff --git a/src/logos/kfulogo_claim.pdf b/src/logos/kfulogo_claim.pdf new file mode 100644 index 0000000..1ed5100 Binary files /dev/null and b/src/logos/kfulogo_claim.pdf differ diff --git a/template/letter.typ b/template/letter.typ new file mode 100644 index 0000000..8ca3947 --- /dev/null +++ b/template/letter.typ @@ -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) +]] + diff --git a/typst.toml b/typst.toml new file mode 100644 index 0000000..7b9db65 --- /dev/null +++ b/typst.toml @@ -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]