Numbering in Paragraph Styles

When a paragraph style references a numbering definition and level which shall also be applied, that reference shall be done in a way slightly different from the typical numbering reference as follows:

  • When a numbering reference is created as direct formatting, that reference consists of a reference to the numbering definition instance + a numbering level

example:
<w:p>
  <w:pPr>
    <w:numPr>
      <w:ilvl w:val="0" />
      <w:numId w:val="5" />
    </w:numPr>
  </w:pPr>
  <w:r>
    <w:t>Level one</w:t>
  </w:r>
</w:p>

The <numPr> element contains two pieces of information:

  • The <numId> element (the numbering definition instance referenced)

  • The <ilvl> element (the level within that numbering definition)

  • When numbering is done as part of a paragraph style, that reference consists of a reference to the numbering definition only. The numbering definition then in turn has a reference to the paragraph style on the level which shall be associated with this style

example:
<w:p>
  <w:pPr>
    <w:pStyle w:val="TestParagraphStyle"/>
  </w:pPr>
  <w:r>
    <w:t>Level one</w:t>
  </w:r>
</w:p>

The paragraph references the style via its @styleId attribute, which itself looks like this:

<w:style w:styleId="TestParagraphStyle"  >
  <w:pPr>
    <w:numPr>
      <w:numId w:val="5" />
    </w:numPr>
  </w:pPr>
</w:style>

The <numPr> element contains one piece of information:

  • The <numId> element (the numbering definition instance referenced)

Obviously, this is insufficient to apply the numbering since we need to know which level to apply, so this information is specified on the appropriate level using the <pStyle> element:

<w:abstractNum w:abstractNumId="1">
  ...
  <w:lvl w:ilvl="0">
    ...
    <w:pStyle w:val="TestParagraphStyle" />
    <w:pPr>
      <w:tabs>
        <w:tab w:val="num" w:pos="720" />
      </w:tabs>
      <w:ind w:left="720" w:hanging="360" />
    </w:pPr>
    ...
  </w:lvl>
</w:abstractNum>

In this case, level 0 of the underlying abstract numbering definition specifies that it is associated with paragraph style TestParagraphStyle, so this level of the numbering shall be applied along with the paragraph style. ]

When numbering is referenced by a paragraph style, its properties shall be applied before the style's properties (the style's paragraph properties shall override the numbering level's paragraph properties).