Applying Numbering to Paragraphs

Once numbering information is defined in the numbering part, this information must be associated with paragraphs within the document in order to display numbering on one or more paragraphs of content.

To accomplish this, numbered paragraphs are identified by the <numPr> element within the paragraph's properties element (the <pPr> element). The numbering properties within a paragraph are specified using two specific elements that specify the numbering definition information to use:

  • A numbering definition instance reference

  • A numbering level reference

The numbering definition instance reference is specified using the <numId> element. This element contains a reference to the @numId attribute in a specific numbering definition instance within the numbering part, which links this paragraph to that numbering definition instance.

The numbering level reference is specified using the <ilvl> element. This element contains a reference to the @ilvl attribute in the specified numbering definition instance's level information, which specifies the numbering level within the referenced numbering definition instance to be used by this numbered paragraph.

Consider the following numbered paragraphs in a WordprocessingML document:

These four numbered paragraphs, all referencing the same numbering definition, produce the following WordprocessingML:

<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 item one</w:t>
  </w:r>
</w:p>
<w:p>
  <w:pPr>
    <w:numPr>
      <w:ilvl w:val="1" />
      <w:numId w:val="5" />
    </w:numPr>
  </w:pPr>
  <w:r>
    <w:t>Level two item one</w:t>
  </w:r>
</w:p>
<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 item two</w:t>
  </w:r>
</w:p>
<w:p>
  <w:pPr>
    <w:numPr>
      <w:ilvl w:val="1" />
      <w:numId w:val="5" />
    </w:numPr>
  </w:pPr>
  <w:r>
    <w:t>Level two item one</w:t>
  </w:r>
</w:p>

In these numbered paragraphs, level 0 and 1 of the numbering definition are referenced through the <ilvl> element with a @val attribute of 0 or 1, respectively, however, the <numId> element always references the numbering definition instance with a @val of 5.

The numbering at any particular numbering level is restarted when a paragraph in the current document from the same numbering definition uses the level specified in the <lvlRestart> element for this numbering level.

Consider a set of numbered paragraphs in a WordprocessingML document where:

  • Level 1 is set to restart after each level 0 (<lvlRestart> of 1)

  • Level 2 is set to never restart (<lvlRestart> of 0)

As the example shows, the numbering at level 1 (a, b, c, and so on) restarts after each level 0 is used, but level 2 (i, ii, iii, and so on) never restarts.