Edit online

Generating a Table of Contents in DITA

In DITA, the order and hierarchy of the table of contents of a document is based directly on the DITA map that defines the document. In most cases, the processor generates a table of contents (TOC) based on the hierarchy of the topics in a DITA map. By default, each <topicref> element in a map represents a node in the TOC.

It is also possible to instruct DITA where the table of contents should occur (or other content lists, such as a list of figures or tables). If you want to instruct the processor to generate a table of contents at a particular location within your DITA map structure, you can use the <toc> element in a bookmap (as in the example below). For more information about the <toc> element, see https://docs.oasis-open.org/dita/v1.2/os/spec/langref/toc.html.

Example:
<bookmap>
.....
  <frontmatter>
    <booklists>
      <toc href="chapter1.dita"/>
    </booklists>
  </frontmatter>
.....