Pandoc is adding a style to a docx even though the style is already existing #10559
Replies: 4 comments 1 reply
-
Certainly sounds like a bug. Can you upload your reference.docx so I can test? |
Beta Was this translation helpful? Give feedback.
-
Sure, here you go |
Beta Was this translation helpful? Give feedback.
-
Your reference.docx contains a paragraph style called VE. For formatting a span, you need a character style. So, pandoc adds a character style called VE. You should be able to fix this by making your style a character style. Ideally pandoc shouldn't create another style with the same styleId as an existing style, so perhaps there is a small bug there, but fixing that wouldn't solve your problem. |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into it! That solved the issue |
Beta Was this translation helpful? Give feedback.
-
I have the following markdown document
[Get out]{custom-style="VE"}, he said.
I want to translate the document to a docx and use the following custom reference file. The reference file already has a style named "VE" in it that makes the text red.
when i unzip the reference.docx it grep for the "VE", I find
w:styleId="VE"><w:name w:val="VE"/><w:basedOn w:val="Definition"/><w:qFormat/><w:rsid w:val="0027743D"/><w:rPr><w:color w:val="FF0000"/></w:rPr></w:style></w:styles>
So far so good.
Now I translate the markdown using pandoc as follows:
The text "Get out" has the style "VE" in the word document. However, it is not the style that has already been in the docx reference before. Instead, pandoc added a second style of the same name to the document.
When I unzip the resuling docx and grep for "VE" again, I find that it now really has two stlyes named "VE"
w:lineRule="auto" /><w:outlineLvl w:val="9" /></w:pPr></w:style><w:style w:customStyle="1" w:styleId="VE" w:type="paragraph"><w:name w:val="VE" /><w:basedOn w:val="Definition" /><w:qFormat /><w:rsid w:val="0027743D" /><w:rPr><w:color w:val="FF0000" /></w:rPr></w:style><w:style w:type="character" w:customStyle="1" w:styleId="VE"><w:name w:val="VE" /><w:basedOn w:val="BodyTextChar" /></w:style><w:style w:type="paragraph" w:customStyle="1" w:styleId="SourceCode"><w:name w:val="Source Code" /><w:basedOn w:val="Normal" /><w:link w:val="VerbatimChar" /><w:pPr><w:wordWrap
The manual on the other hand states: "If they are already defined, pandoc will not alter the definition."
Is this a bug or am I missing anything here?
Beta Was this translation helpful? Give feedback.
All reactions