3

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?

2 Answers 2

6

pandoc 1.19.2.1 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-1.19.2.1 version, I don't know when this has been introduced.

0

Also, you can convert batch (multiple) files with pandoc, if you use these lines:

.docx convert to .txt

for i in *.docx ; do echo "$i" && pandoc -s --wrap=none $i -o $i.txt ; done 

.doc convert to .docx

for i in *.doc ; do echo "$i" && pandoc -s --wrap=none $i -o $i.doc ; done 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.