Custom docx template in quarto ? #14695
-
DescriptionHi, I want to generate DOCX file out of my quarto projects (among other outputs like html and pdf), but respecting my company's template. I'm quite sure I'm not the only one with that need, I see it surfaces in questions/issues but with no clear implementation path. I have read the "ms-word-templates" doc here : https://quarto.org/docs/output-formats/ms-word-templates.html From what I understood pandoc has actually two different options allowing to customize the docx output :
This link has helped a lot : https://rnwest.engineer/auto-generate-docx-with-pandoc/ My question then : is there a way to inject the pandoc Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
I have tried finding that Using Could you also help me locate this in the quarto distribution ? I only see a quite big |
Beta Was this translation helpful? Give feedback.
-
|
Quarto CLI does not use the "template" form for docx, only the reference doc (when The template you are mentioning is Pandoc, find it on Pandoc: https://github.com/jgm/pandoc/blob/main/data/templates/default.openxml edit: This works: ---
format:
docx:
template: template.xml
---
{{< lipsum 2 >}} |
Beta Was this translation helpful? Give feedback.
-
|
Damned, so easy I didn't even try it ! Thanks, this open lots of doors for customisation of the output. |
Beta Was this translation helpful? Give feedback.
Quarto CLI does not use the "template" form for docx, only the reference doc (when
templateis provided, it's mostly Pandoc that handles it)Not sure
template:YAML will pass on the template also fordocx, as it would for all other formats, but you can try.The template you are mentioning is Pandoc, find it on Pandoc: https://github.com/jgm/pandoc/blob/main/data/templates/default.openxml
edit: This works: