pydocx icon indicating copy to clipboard operation
pydocx copied to clipboard

Libreoffice requires abstractNum definitions to appear before num definitions

Open kylegibson opened this issue 9 years ago • 0 comments

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.

kylegibson avatar May 20 '15 21:05 kylegibson