I am trying to convert a txt file (markdown) to docx using pandoc with a special MS Word template. I'm doing it this way:

pandoc -s --reference-docx=/path/to/my/template.dotx -o outfield.docx file.md

The problem is that I have set up my template with a special "Body Paragraph" style, separate from the "Normal" style (because the various headings, etc. all are based on the "Normal" style. Is there a way to tell pandoc that when it converts normal paragraph text that it should be styled using my special "Body Paragraph" style?


pandoc uses three styles for body text: Normal, Body Text, and First Paragraph, which are based onto each other in this order. If you want a specific styling of your body text only, you should hence edit the Body Text style in the template, not the Normal style as changes to the Normal style -- as you already mentioned -- propagate to other styles as well.

See the part on the --reference-docx option in the 'Options Affecting Specific Writers' section of the pandoc user manual.

This feature might exist pre- version, I don't know when this has been introduced.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.