# Numbering Sections

Section headings (`H2`to`H6` elements) can be automatically numbered to reflect the document structure. The `H1` element is supposed to be the document title and is not numbered. Other headings receive a number that is computed according to their type and their position in the document structure. These numbers are generated in the document itself and previous generated numbers are removed, each times the XHTML>Section numbering command is called.

# Table of Contents

The XHTML>Generate Table of contents command collects all following `H2` to `H6` elements in the document to generate a table of contents at the current position. It updates the current one if the selection is already a table of contents.

This command adds:

- An `id` attribute to each `H2` to `H6` element which doesn't have this attribute.
- A division with a "toc" `class` attribute value and a cascade of unnumbered lists at the current position.
- A list item for each H2 to H6 element including a link which points to the corresponding element.

  The link element contents is a copy of the Hi element. If the Hi element is numbered, this number is also copied.