This is a Quarto template that assists you in creating a manuscript using the letter format.
You can use this as a template to create a letter. To do this, use the following command:
quarto use template mcanouil/quarto-letter@1.2.0This will install the extension and create an example qmd file and bibliography that you can use as a starting place for your article.
You may also use this format with an existing Quarto project or document. From the quarto project or document directory, run the following command to install this format:
quarto add mcanouil/quarto-letter@1.2.0To use the format, you can use the format name letter-pdf1.
For example:
quarto render template.qmd --to letter-pdfor in your document yaml
format: letter-pdf| Option | Type | Default | Description |
|---|---|---|---|
address |
array | (required) | Recipient address lines. The render logs an error if missing or empty. |
subject |
string | Letter subject line. | |
subject-title |
string | Subject |
Label preceding the subject line. |
subject-suffix |
string | : |
Character appended after the subject title. |
opening |
string | Opening salutation. | |
closing |
string | Closing salutation. | |
cc |
array | Carbon copy recipients. | |
encl |
array | List of enclosures. | |
ps |
string | Postscript text appended after the closing. | |
header-image |
string | Path to a letterhead image inserted above the opening salutation. | |
header-image-width |
string | \textwidth |
LaTeX width for the letterhead image (e.g. 0.5\textwidth, 8cm). |
signature-image |
string | Path to a signature image inserted between the closing salutation and the printed name (digital signature). | |
signature-image-width |
string | 4cm |
LaTeX width for the signature image (e.g. 4cm, 0.3\textwidth). |
It is possible to change the subject title and the subject suffix, e.g., for a French letter:
format:
letter-pdf:
subject-title: Objet
subject-suffix: " :"The extension ships matching code snippets (meta for English, meta-fr for French, meta-sig for a letter with a signature image) that can be triggered in editors with Quarto IDE integration.
To include a letterhead and a digital signature image:
format:
letter-pdf:
header-image: letterhead.png
header-image-width: "0.5\\textwidth"
signature-image: signature.png
signature-image-width: 4cmNote
Width values are passed through to \includegraphics, so any LaTeX dimension is accepted (e.g. 4cm, 0.5\textwidth, 120pt).
Use double backslashes in YAML double-quoted strings ("0.5\\textwidth") so the literal backslash is preserved.
The extension emits prefixed diagnostics during rendering:
- An error when the required
addressfield is missing or empty. - A warning when
subject-titleis set butsubjectis empty. - A warning when
subjectorsubject-titlecontains raw HTML tokens (e.g.<x>), which Pandoc strips from LaTeX output.
You can view a preview of the rendered template at https://m.canouil.dev/quarto-letter/index.pdf.