1
votes

I am trying to learn Basics of Markdown and Pandoc to speed up my academic writing.

I would like to ask whether it possible to define font family and font size, when converting from Markdown (.md) file to Word-2016 (.docx) file? I tried two methods:

  1. I added
---
mainfont: "Palatino"
---

to the *.md file.

  1. I tried to add -- variable mainfont="Palatino" to the command line when converting files.

Neither method produces desired font change. Could anyone advise on the proper method of setting the font, if it is possible to do so during the conversion procedure?

Edit: I have followed guidelines presented in the article "Sustainable Authorship" on programminghistorian.org, where they suggest using mainfont: times in YAML. I would like to know why it is not working for me. My question is not duplicate, I do not need different fonts/styles for text body and headings. I need to have everything uniformly converted into "Arial" or "Palatino". Edit: I have tried to create a reference .docx file, however, I cannot understand how to make changes to the reference file, so these changes are implemented when Pandoc converting my markdown to .docx.

1
you've seen pandoc.org/MANUAL.html ?mb21
My problem is how to modify a .docx reference style file, which can be used by pandoc to style my markdown. One has to be a Microsoft Word power user to create a decent style file.user136555
I have seen this Answer. My problem is here: "Change the font in the style. Either by opening the file in Word, changing the style and saving it". I had to go to Microsoft Word manuals to find out how to apply the changes to the "reference" .docx file. This is my problem.user136555

1 Answers

2
votes

As mentioned in the MANUAL, the mainfont variable doesn't work for docx output, only PDF/LaTeX/ConTeX etc..

For Word, you need to use the --reference-doc option.

See also https://stackoverflow.com/a/34609460/214446