Rendering a microsoft word document using pandoc. The font seems to default to Calibri for headings and Cambri for body text. Goal is to have the file use Arial or Times roman fonts.
I don't want to touch/edit/have anything to do with the file in word.
How can I set the font that will be used in Word™ from either the multi-markdown source or in the call to pandoc?
Pandoc command:
pandoc -s my_markdown.txt -o whycambriafont.docx
This question: pandoc-generated docx misses italic variables in equations shows a way to edit the font styles by creating a zip and then editing the style files, but is a kludge.
You can supply a reference.docx file with the --reference-doc option to pandoc which acts sort of like a template.
echo 'hello word' | pandoc -o reference.docx
or similar.vim
:
reference.docx
to reference.zip
vim reference.zip
and select reference/theme/theme1.xml
Calibri
to Arial
pandoc --reference-doc reference.docx
See also Defining-custom-DOCX-styles-in-LibreOffice-(and-Word).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With