pydocx
pydocx copied to clipboard
Libreoffice requires abstractNum definitions to appear before num definitions
For example, the following numbering definition will be properly read (i.e. the first level in a list that uses this definition will use lowerRoman
)
<?xml version="1.0"?>
<w:numbering xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:abstractNum w:abstractNumId="1">
<w:lvl w:ilvl="0">
<w:numFmt w:val="lowerRoman"/>
</w:lvl>
</w:abstractNum>
<w:num w:numId="1">
<w:abstractNumId w:val="1"/>
</w:num>
</w:numbering>
The following example, however, does not. Instead, libreoffice doesn't use the numFmt
. Instead it uses decimal
:
<?xml version="1.0"?>
<w:numbering xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:num w:numId="1">
<w:abstractNumId w:val="1"/>
</w:num>
<w:abstractNum w:abstractNumId="1">
<w:lvl w:ilvl="0">
<w:numFmt w:val="lowerRoman"/>
</w:lvl>
</w:abstractNum>
</w:numbering>
PyDocX is able to handle both.