-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't add styles in the output document when converting with the option --reference-doc #10088
Comments
Pandoc is also adding some settings in <w:displayHorizontalDrawingGridEvery w:val="0"/>
<w:displayVerticalDrawingGridEvery w:val="0"/>
<w:doNotTrackMoves/>
<w:drawingGridHorizontalSpacing w:val="360"/>
<w:drawingGridVerticalSpacing w:val="360"/>
<w:embedSystemFonts/>
<w:footnotePr>
<w:footnote w:id="0"/>
<w:footnote w:id="-1"/>
</w:footnotePr>
<w:hyphenationZone w:val="425"/>
<w:listSeparator w:val=";"/>
<w:proofState w:grammar="clean" w:spelling="clean"/>
<w:rsids/>
<w:savePreviewPicture/>
<w:stylePaneFormatFilter w:val="0004"/> |
We do carry over some things from the reference.docx. But if we just used everything, we'd get corrupt files (tried that; see e.g. #9522). So we use a conservative approach to guarantee that the docx we produced is not corrupt. It may be that we can be less conservative about some things. See also #7240. |
Here is the code relevant to generating settings.xml: https://github.com/jgm/pandoc/blob/main/src/Text/Pandoc/Writers/Docx.hs#L474-L577 |
The styles |
PS. Also please state your pandoc version. |
Don't add any other styles in the output document other than the ones existing in the input document when converting with the option
--reference-doc
(and the extension+styles
)Currently when converting a DOCX-Document with the
+styles
extension and itself as--reference-doc
withpandoc input.docx -f docx+styles -t docx -o output.docx --reference-doc input.docx
following styles are added in the output document (which were not in the input document):
AlertTok
,AnnotationTok
,AttributeTok
,BaseNTok
,BuiltInTok
,CharTok
,CommentTok
,CommentVarTok
,ConstantTok
,ControlFlowTok
,DataTypeTok
,DecValTok
,DocumentationTok
,ErrorTok
,ExtensionTok
,FloatTok
,FunctionTok
,ImportTok
,InformationTok
,KeywordTok
,NormalTok
,OperatorTok
,OtherTok
,PreprocessorTok
,RegionMarkerTok
,SourceCode
,SpecialCharTok
,SpecialStringTok
,StringTok
,VariableTok
,VerbatimStringTok
,WarningTok
The input.docx is an empty document created with a "clean"
Normal.dotm
.Is there a way to disable the creation of those styles when the
--reference-doc
option is given?The text was updated successfully, but these errors were encountered: