Pandoc: docx and --number-sections

Created on 11 Jul 2014  路  5Comments  路  Source: jgm/pandoc

It would be great if the DocXWriter would also handle the --number-sections parameter.

Indeed, it seem to be possible to apply the list style 'Headings' predifined by Word after opening the document or adjusting the reference.docx accordingly to avoid repetitions and automate the conversion process.
Unfortunately, that's not possible with non-english Word versions. I struggled with this problem the last two days and found no solution.
Even changing the UI language of Word to British or American English does not solve the problem. Word (I'm using 2010 version with multilanguage pack and pandoc 1.12.4.2) always blows up the reference.docx after saving, even in compatibility mode. It changes nearly all style names and translates it to the local language.
Defining a custom multilevel list style is possible but it is impossible to change it afterwards. Even if I use a custom list style with the english names, pandoc does not seem to use it. I get incorrect numbering.

I just want to have

1 Heading 1
1.1 Heading 2
1.1.1 Heading 3
...

but get

. Heading 1
   - Heading 2
     a Heading 3

Maybe that is related to #1305 but the language problem still persists. Many users don't have a multilanguage version of Word.

Also, I was not able to find a native english normal.docx which contains the correct list style. If one can provide such a file or reference-numbered-sections.docx i.e. in the Wiki User contributed templates that would be very helpful. Then I can merge the corresponding parts of numbering.xml and style.xml into my own reference.docx.

But the best would be if pandoc itself would insert the correct fragments into numbering.xml or style.xml. The fix of #1305 indicates that the numbering.xml is now merged. Hence it would be easy to extend by the number-sections fragment.

enhancement Docx writer

Most helpful comment

It would be so nicer if someone could provide reference-numbered-sections.docx template to pandoc wiki so that those who have the same issue can get help there.

All 5 comments

I can confirm that it works with the current development version.

Nevertheless, I believe the main extension is still highly useful.

On difficulty arose: headings marked as non-numbered (followed by a {-}) still get a number in Word. That should be treated differently and of course automatically (just by removing the numbering format). Doing all this stuff manually is really boring. ;-)

After a while I found that using MSWord's outline numbering feature, then use the modified output as reference docx works.

It would be so nicer if someone could provide reference-numbered-sections.docx template to pandoc wiki so that those who have the same issue can get help there.

It would be so nicer if someone could provide reference-numbered-sections.docx template to pandoc wiki so that those who have the same issue can get help there.

Done!

Found this thread when looking for a solution myself. Made a reference docx and linked to it from the pandoc wiki.

Thanks @krissen! It looks great!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

krobelus picture krobelus  路  4Comments

timtroendle picture timtroendle  路  3Comments

eins78 picture eins78  路  5Comments

felixsanz picture felixsanz  路  5Comments

XiaTeng1993 picture XiaTeng1993  路  3Comments