TOC file format

The following fragment shows the structure of a typical TOC file produced by TopLeaf:

<tl:toc2>
  <tl:tocline>
    <tl:title id="tl:Mapman.27" >The <emph>Font</emph> Tab</tl:title>
    <tl:folio id="tl:Mapman.27" >35</tl:folio>
  </tl:tocline>
  <tl:toc3>
    <tl:tocline>
      <tl:title id="tl:Mapman.103" >Selecting a Font</tl:title>
      <tl:folio id="tl:Mapman.103" >35</tl:folio>
    </tl:tocline>
  </tl:toc3>
  <tl:toc3>
    <tl:tocline>
      <tl:title id="tl:Mapman.269" >Font Characteristics</tl:title>
      <tl:folio id="tl:Mapman.269" >37</tl:folio>
    </tl:tocline>
  </tl:toc3>
</tl:toc2>

Each TOC level has a tl:tocline element containing a title and a folio label that identifies the page on which the entry is defined. The title will contain any child elements that were present in the original data.

Custom markers in the title will be identified by the __MMCT: prefix. When these are processed they will trigger custom mappings that use the normal % prefix.

The inclusion of the original title markup allows effects (such as emphasis or subscripting) to be reproduced in the TOC if desired. If you do not want such effects preserved, define a mapping (for example, tl:title/emph) which does nothing. This will override the default behavior of the tag in question.

A common requirement when formatting a TOC is to place the page labels at the right margin, sometimes preceded by leader dots. The <fill> command provides an easy way to do this.

The id attributes can be used to create a link to the point in the data that generated the TOC entry. If the element contains an attribute called idtype with value auto it means that the id attribute value was generated automatically. Note that automatically-generated link values may change depending on the preceding content, so additional composition passes may be required when using them. See “Automatic link targets” for more information.