3  Word Quirks

Quarto supports rendering to Microsoft Word (.docx) and allows you to customise the output using a reference Word document. This is useful for applying corporate styles, headers, footers, and other Word-specific formatting. For more details, see:

Quarto Word Output Formats Quarto Word Templates

3.1 Using a Reference Word Document

To apply custom Word styles, specify a reference .docx file in your document’s YAML front matter. This file can include:

  • Headers and footers
  • Custom paragraph and text styles
  • Page layout settings

Example YAML:

format:
  docx:
    reference-doc: "Reference Doc/vacancy_report_template.docx"

Use the following YAML to use a reference .docx file. This file can contain all the usual content a .docx file might have. Like headers, footers, custom word styles

3.2 Applying Custom Word Styles in Quarto

You can apply styles defined in your reference document using custom attributes. For example:

::: {custom-style="Key Points"}
This text will be in the "Key Points" style.
:::
format: docx: reference-doc: Reference Doc/vacancy_report_template.docx

Use bold over any parameterised value to indicate to end users that this part of text has been dynamic.

3.3 How to create breaks

To insert a page break in Word output, use:

\pagebreak

For linebreaks:

\