From 0b5c18ec8822a1f833599d16d82438aa9ea0c6af Mon Sep 17 00:00:00 2001 From: Blezz-tech <72557631+Blezz-tech@users.noreply.github.com> Date: Sat, 22 Jun 2024 16:27:37 +0300 Subject: [PATCH] added optional option to override the "dear" variable --- lib.typ | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib.typ b/lib.typ index d97fc41..07db6cf 100644 --- a/lib.typ +++ b/lib.typ @@ -646,7 +646,8 @@ /// Letter heading for a given job position and addressee. /// - job-position (string): The job position you are applying for /// - addressee (string): The person you are addressing the letter to -#let letter-heading(job-position: "", addressee: "") = { +/// - dear (string): optional field for redefining the "dear" variable +#let letter-heading(job-position: "", addressee: "", dear: "") = { let lang_data = toml("lang.toml") // TODO: Make this adaptable to content @@ -655,7 +656,12 @@ ] pad(top: 1em, bottom: 1em)[ #text(weight: "light", fill: color-gray)[ - #linguify("dear", from: lang_data) #addressee, + #if dear == "" [ + #linguify("dear", from: lang_data) + ] else [ + #dear + ] + #addressee, ] ] }