diff --git a/packages/preview/almost-tud-letter/0.1.0/LICENSE b/packages/preview/almost-tud-letter/0.1.0/LICENSE new file mode 100644 index 0000000000..28b5f250ae --- /dev/null +++ b/packages/preview/almost-tud-letter/0.1.0/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Hugo Ledoux + +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, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. diff --git a/packages/preview/almost-tud-letter/0.1.0/README.md b/packages/preview/almost-tud-letter/0.1.0/README.md new file mode 100644 index 0000000000..1406cea073 --- /dev/null +++ b/packages/preview/almost-tud-letter/0.1.0/README.md @@ -0,0 +1,49 @@ +# almost-tud-letter + +A Typst template that (more or less) replicates the [TUDelft letter](https://www.tudelft.nl/huisstijl/) (only available in Word). +It also makes it more beautiful in my opinion, but hey I guess it's subjective... + +By default it's in English and the faculty name is my faculty... but you can modify it, see the example. +You can also put `lang: "nl"` so that the fields top-left are in Dutch. + +## How to use it? + +You can compile the example letter with this command: + +`typst compile --root . template/letter.typ` + +Notice that you can also install the package manually to your local Typst, see instruction there: + + + +## Example + +```typst +#import "@preview/almost-tud-letter:0.1.0": * + +#show: almost-tud-letter.with( + from: ( + name: "Jan Smit", + phone: "+31 (0)15 27 12345", + email: "j.smit@tudelft.nl", + ), + to: [ + Gerard Joling \ + Singer of the year \ + ], + date: datetime.today().display(), + subject: "A very important letter", +) + +Dear Gerard, + +#lorem(60) + +#lorem(100) + +#v(1cm) +Best regards, +#v(3mm) +Dr Jan Smit \ +Head of an important department +``` diff --git a/packages/preview/almost-tud-letter/0.1.0/assets/tudlogo.svg b/packages/preview/almost-tud-letter/0.1.0/assets/tudlogo.svg new file mode 100644 index 0000000000..457897daa6 --- /dev/null +++ b/packages/preview/almost-tud-letter/0.1.0/assets/tudlogo.svg @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/almost-tud-letter/0.1.0/src/lib.typ b/packages/preview/almost-tud-letter/0.1.0/src/lib.typ new file mode 100644 index 0000000000..7254fda449 --- /dev/null +++ b/packages/preview/almost-tud-letter/0.1.0/src/lib.typ @@ -0,0 +1,116 @@ +#let almost-tud-letter( + from: "", + to: "", + date: datetime.today().display(), + subject: "", + lang: "en", + faculty: ( + name: "Faculty of Architecture and the Built Environment", + address: ( + ( + what: "address", + value: [Julianalaan 134 \ Delft 2628BL \ the Netherlands], + ), + ), + ), + body, +) = { + + let body-font = "Source Sans Pro" + + let tags = ( + thedate: "date", + thecontact: "contact", + theemail: "email", + thephone: "phone", + thesubject: "subject", + ) + if lang == "nl" { + tags = ( + thedate: "datum", + thecontact: "contact", + theemail: "email", + thephone: "telefoon", + thesubject: "onderwerp", + ) + } + + set text( + font: body-font, + size: 11pt, + ) + set par(justify: true) + + set page( + paper: "a4", + margin: ( + top: 12mm, + bottom: 2cm, + left: 3cm, + right: 3cm + ), + background: { + // folding mark 1 + place(top + left, dx: 5mm, dy: 105mm, line( + length: 2.5mm, + stroke: 0.25pt + black + )) + // folding mark 2 + place(top + left, dx: 5mm, dy: 210mm, line( + length: 2.5mm, + stroke: 0.25pt + black + )) + }, + footer: context [ + #set align(right) + #set text(luma(80), 9pt) + Page + #counter(page).display( + "1 of 1", + both: true, + ) + ], + number-align: center, + ) + + + grid( + columns: (10cm, auto), + gutter: 8pt, + align: (top, bottom), + grid( + columns: (-3mm, 10cm), + gutter: 8pt, + align: (right, left), + text(size: 9pt, luma(80), raw(tags.thedate)), text(size: 9pt, date), + text(size: 9pt, luma(80), raw(tags.thecontact)), text(size: 9pt, from.name), + text(size: 9pt, luma(80), raw(tags.theemail)), text(size: 9pt, link(from.email)), + text(size: 9pt, luma(80), raw(tags.thephone)), text(size: 9pt, from.phone), + text(size: 9pt, luma(80), raw(tags.thesubject)), text(size: 9pt, subject), + ), + image("../assets/tudlogo.svg", width: 144%) + ) + + v(2cm) + + grid( + columns: (10cm, auto), + gutter: 10pt, + to, + [ + *#faculty.name* \ + \ + #for a in faculty.address { + [ + #text(size: 9pt, luma(80), a.what) \ + #a.value + ] + v(2mm) + } + ] + ) + + v(2cm) + + body +} diff --git a/packages/preview/almost-tud-letter/0.1.0/template/letter.typ b/packages/preview/almost-tud-letter/0.1.0/template/letter.typ new file mode 100644 index 0000000000..8d705ca8f2 --- /dev/null +++ b/packages/preview/almost-tud-letter/0.1.0/template/letter.typ @@ -0,0 +1,42 @@ +#import "@preview/almost-tud-letter:0.1.0": * +// #import "../src/lib.typ": * + +#show: almost-tud-letter.with( + // lang: "nl", + from: ( + name: "Jan Smit", + phone: "+31 (0)15 27 12345", + email: "j.smit@tudelft.nl", + ), + to: [ + Gerard Joling \ + Singer of the year \ + ], + date: datetime.today().display(), + subject: "A very important letter", + // faculty: ( + // name: "Faculteit Bouwkunde", + // address: ( + // ( + // what: "bezoek", + // value: [Julianalaan 134 \ Delft 2628BL], + // ), + // ( + // what: "correspondentie", + // value: [Postbus 5043 \ 2600 GA Delft], + // ), + // ), + // ), +) + +Dear Gerard, + +#lorem(60) + +#lorem(100) + +#v(1cm) +Best regards, +#v(3mm) +Dr Jan Smit \ +Head of an important department diff --git a/packages/preview/almost-tud-letter/0.1.0/thumbnail.png b/packages/preview/almost-tud-letter/0.1.0/thumbnail.png new file mode 100644 index 0000000000..fce2ad9760 Binary files /dev/null and b/packages/preview/almost-tud-letter/0.1.0/thumbnail.png differ diff --git a/packages/preview/almost-tud-letter/0.1.0/typst.toml b/packages/preview/almost-tud-letter/0.1.0/typst.toml new file mode 100644 index 0000000000..7c7408db28 --- /dev/null +++ b/packages/preview/almost-tud-letter/0.1.0/typst.toml @@ -0,0 +1,16 @@ +[package] +entrypoint = "src/lib.typ" +name = "almost-tud-letter" +version = "0.1.0" +compiler = "0.13.0" +authors = ["Hugo Ledoux <@hugoledoux>"] +repository = "https://github.com/hugoledoux/almost-tud-letter" +description = "A template that (almost!) replicates the TUDelft letter" +keywords = ["TU Delft", "letter"] +license = "MIT" +categories = ["office"] + +[template] +path = "template" +entrypoint = "letter.typ" +thumbnail = "thumbnail.png"