When using markdown code blocks the resulting monospace font size is too large in DOCX documents.
I can adjust the font size of paragraphs by specifying a custom
Using Pandoc 1.17.2 and Word 2013 I have finally found a solution, it seems later versions of Pandoc uses a linked style that is by default hidden in Word.
Step 1: Generate a custom template file using
pandoc -o template_1.17.2.docx test.md
Where test.md includes source code and all other styles you may want to modify. For example:
~~~~
this is preformatted source using style "Source Code"
~~~~
~~~ xml
is preformatted source using "KeyworkTok" and "NormalTok"
~~~
Open template_1.17.2.docx in Word. The preformatted source is now formatted using the hidden linked style "Source Code". This style is NOT displayed in the styles preview pane by default, you can add it by configuring the styles preview pane by clicking the tiny square-with-arrow in the bottom right of the styles preview panel.
Modify this style as you wish and save the template. Then generate your document based on this template:
pandoc --reference-docx=template_1.17.2.docx -o mydoc.docx mydoc.md
You should now see the source properly formatted in mydoc.
@LinusR suggests that different source styles uses different Layout styles. I have added XML as an example. The formatted XML will use "KeywordTok" and "NormalTok".