Macro to display a
Table Of Content in a given
Sink.
The input parameters for this macro are:
- section
- Display a TOC for the specified section only, or all sections if 0.
Positive int, not mandatory, 0 by default.
- fromDepth
- Minimal depth of entries to display in the TOC.
Sections are depth 1, sub-sections depth 2, etc.
Positive int, not mandatory, 0 by default.
- toDepth
- Maximum depth of entries to display in the TOC.
Positive int, not mandatory, 5 by default.
For instance, in an APT file, you could write:
- %{toc|section=2|fromDepth=2|toDepth=3}
- Display a TOC for the second section in the document, including all
subsections (depth 2) and sub-subsections (depth 3).
- %{toc}
- display a TOC with all section and subsections
(similar to %{toc|section=0} )
Moreover, you need to write APT link for section to allow anchor,
for instance:
* {SubSection 1}
Similarly, in an XDOC file, you could write:
<macro name="toc">
<param name="section" value="1" />
<param name="fromDepth" value="1" />
<param name="toDepth" value="2" />
</macro>