-
Notifications
You must be signed in to change notification settings - Fork 693
almost-tud-letter:0.1.0 #3091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hugoledoux
wants to merge
9
commits into
typst:main
Choose a base branch
from
hugoledoux:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
almost-tud-letter:0.1.0 #3091
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d744974
Add files v0.1.0 of tud-letter
hugoledoux 66caff9
Rename package from 'tudletter' to 'tud-letter'
hugoledoux dae2011
Fix author username formatting in typst.toml
hugoledoux ecd6eb4
Update packages/preview/tud-letter/0.1.0/README.md
hugoledoux 5c71e3c
Rename package to 'almost-tud-letter'
hugoledoux d52e0b9
Fix description punctuation in typst.toml
hugoledoux 0bb3770
Change import from tud-letter to almost-tud-letter
hugoledoux 0079cc2
Rename project from 'tud-letter' to 'almost-tud-letter'
hugoledoux 0192730
Change name of package and thus the folder name too
hugoledoux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# 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 IMO, 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: | ||
<https://github.com/typst/packages?tab=readme-ov-file#local-packages> | ||
|
||
|
||
## Example | ||
|
||
```typst | ||
#import "../src/lib.typ": * | ||
|
||
#show: 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 | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
#let 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 | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#import "@preview/tud-letter:0.1.0": * | ||
// #import "../src/lib.typ": * | ||
|
||
#show: 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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
entrypoint = "src/lib.typ" | ||
name = "tud-letter" | ||
hugoledoux marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
version = "0.1.0" | ||
compiler = "0.13.0" | ||
authors = ["Hugo Ledoux <@hugoledoux>"] | ||
repository = "https://github.com/hugoledoux/tudletter" | ||
description = "A Typst template that (almost?) replicates the TUDelft letter" | ||
hugoledoux marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
keywords = ["TU Delft", "letter"] | ||
license = "MIT" | ||
categories = ["office"] | ||
|
||
[template] | ||
path = "template" | ||
entrypoint = "letter.typ" | ||
thumbnail = "thumbnail.png" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.