From 3424d07af41d4f4ddfe6adbf45f2c9e60d07ec50 Mon Sep 17 00:00:00 2001 From: Paul Tsouchlos Date: Tue, 22 Oct 2024 11:44:45 -0400 Subject: [PATCH 1/3] feat: make closing remark in letter optional You can now supply your own text body/function for the letter closing (what goes after the signature) --- lib.typ | 28 +++++++++++++++++++++------- template/coverletter.typ | 2 ++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/lib.typ b/lib.typ index cb8df1c..eab9a22 100644 --- a/lib.typ +++ b/lib.typ @@ -508,6 +508,15 @@ /// ---- Coverletter ---- +#let default-closing(lang_data) = { + align(bottom)[ + #text(weight: "light", style: "italic")[ #linguify( + "attached", + from: lang_data, + )#sym.colon #linguify("curriculum-vitae", from: lang_data)] + ] +} + /// Cover letter template that is inspired by the Awesome CV Latex template by posquit0. This template can loosely be considered a port of the original Latex template. /// This coverletter template is designed to be used with the resume template. /// - author (content): Structure that takes in all the author's information @@ -523,6 +532,7 @@ language: "en", font: ("Source Sans Pro", "Source Sans 3"), show-footer: true, + closing: none, body, ) = { if type(accent-color) == "string" { @@ -532,6 +542,10 @@ // language data let lang_data = toml("lang.toml") + if closing == none { + closing = default-closing(lang_data) + } + set document( author: author.firstname + " " + author.lastname, title: "cover-letter", @@ -558,7 +572,10 @@ ) // set paragraph spacing - set par(spacing: 0.75em, justify: true) + set par( + spacing: 0.75em, + justify: true, + ) set heading( numbering: none, @@ -709,7 +726,7 @@ ) } - let letter-conclusion = { + let signature = { align(bottom)[ #pad(bottom: 2em)[ #text(weight: "light")[#linguify( @@ -717,10 +734,6 @@ from: lang_data, )#sym.comma] \ #text(weight: "bold")[#author.firstname #author.lastname] \ \ - #text(weight: "light", style: "italic")[ #linguify( - "attached", - from: lang_data, - )#sym.colon #linguify("curriculum-vitae", from: lang_data)] ] ] } @@ -729,7 +742,8 @@ letter-heading body linebreak() - letter-conclusion + signature + closing } /// Cover letter heading that takes in the information for the hiring company and formats it properly. diff --git a/template/coverletter.typ b/template/coverletter.typ index 0c489cf..5c7baad 100644 --- a/template/coverletter.typ +++ b/template/coverletter.typ @@ -22,6 +22,8 @@ // Remove the following line to show the footer // Or set the value to `true` show-footer: false, + // set this to `none` to show the default or remove it completely + closing: [], ) #hiring-entity-info(entity-info: ( From 3e2dac44571595d1d433302ddb874119b50c571d Mon Sep 17 00:00:00 2001 From: Paul Tsouchlos Date: Tue, 22 Oct 2024 11:52:26 -0400 Subject: [PATCH 2/3] doc: improve coverletter docs --- lib.typ | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib.typ b/lib.typ index eab9a22..e8066d2 100644 --- a/lib.typ +++ b/lib.typ @@ -519,10 +519,14 @@ /// Cover letter template that is inspired by the Awesome CV Latex template by posquit0. This template can loosely be considered a port of the original Latex template. /// This coverletter template is designed to be used with the resume template. -/// - author (content): Structure that takes in all the author's information +/// - author (content): Structure that takes in all the author's information. The following fields are required: firstname, lastname, positions. The following fields are used if available: email, phone, github, linkedin, orcid, address, website. /// - profile-picture (image): The profile picture of the author. This will be cropped to a circle and should be square in nature. -/// - date (date): The date the cover letter was created +/// - date (datetime): The date the cover letter was created. This will default to the current date. /// - accent-color (color): The accent color of the cover letter +/// - language (string): The language of the cover letter, defaults to "en". See lang.toml for available languages +/// - font (array): The font families of the cover letter +/// - show-footer (boolean): Whether to show the footer or not +/// - closing (content): The closing of the cover letter. This defaults to "Attached Curriculum Vitae". You can set this to `none` to show the default closing or remove it completely. /// - body (content): The body of the cover letter #let coverletter( author: (:), From 15e2dfcc296e4777243d3961490eeca234f80ba2 Mon Sep 17 00:00:00 2001 From: Paul Tsouchlos Date: Tue, 22 Oct 2024 11:52:32 -0400 Subject: [PATCH 3/3] chore: update dependencies --- lib.typ | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib.typ b/lib.typ index e8066d2..3aa5de5 100644 --- a/lib.typ +++ b/lib.typ @@ -1,5 +1,5 @@ -#import "@preview/fontawesome:0.4.0": * -#import "@preview/linguify:0.4.0": * +#import "@preview/fontawesome:0.5.0": * +#import "@preview/linguify:0.4.1": * // const color #let color-darknight = rgb("#131A28")