1 <refentry xmlns="http://docbook.org/ns/docbook"
\r
2 xmlns:xlink="http://www.w3.org/1999/xlink"
\r
3 xmlns:xi="http://www.w3.org/2001/XInclude"
\r
4 xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
\r
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
\r
6 version="5.0" xml:id="generate.toc">
\r
8 <refentrytitle>generate.toc</refentrytitle>
\r
9 <refmiscinfo class="other" otherclass="datatype">table</refmiscinfo>
\r
12 <refname>generate.toc</refname>
\r
13 <refpurpose>Control generation of ToCs and LoTs</refpurpose>
\r
17 <src:fragment xml:id="generate.toc.frag">
\r
18 <xsl:param condition="html" name="generate.toc">
\r
20 article/appendix nop
\r
22 book toc,title,figure,table,example,equation
\r
37 <xsl:param condition="fo" name="generate.toc">
\r
39 article/appendix nop
\r
41 book toc,title,figure,table,example,equation
\r
57 <refsection><info><title>Description</title></info>
\r
59 <para>This parameter has a structured value. It is a table of space-delimited
\r
60 path/value pairs. Each path identifies some element in the source document
\r
61 using a restricted subset of XPath (only the implicit child axis, no wildcards,
\r
62 no predicates). Paths can be either relative or absolute.</para>
\r
64 <para>When processing a particular element, the stylesheets consult this table to
\r
65 determine if a ToC (or LoT(s)) should be generated.</para>
\r
67 <para>For example, consider the entry:</para>
\r
69 <screen>book toc,figure</screen>
\r
71 <para>This indicates that whenever a <tag>book</tag> is formatted, a
\r
72 Table Of Contents and a List of Figures should be generated. Similarly,</para>
\r
74 <screen>/chapter toc</screen>
\r
76 <para>indicates that whenever a document <emphasis>that has a root
\r
77 of</emphasis> <tag>chapter</tag> is formatted, a Table of
\r
78 Contents should be generated. The entry <literal>chapter</literal> would match
\r
79 all chapters, but <literal>/chapter</literal> matches only <tag>chapter</tag>
\r
80 document elements.</para>
\r
82 <para>Generally, the longest match wins. So, for example, if you want to distinguish
\r
83 articles in books from articles in parts, you could use these two entries:</para>
\r
85 <screen>book/article toc,figure
\r
86 part/article toc</screen>
\r
88 <para>Note that an article in a part can never match a <literal>book/article</literal>,
\r
89 so if you want nothing to be generated for articles in parts, you can simply leave
\r
90 that rule out.</para>
\r
92 <para>If you want to leave the rule in, to make it explicit that you're turning
\r
93 something off, use the value <quote>nop</quote>. For example, the following
\r
94 entry disables ToCs and LoTs for articles:</para>
\r
96 <screen>article nop</screen>
\r
98 <para>Do not simply leave the word <quote>article</quote> in the file
\r
99 without a matching value. That'd be just begging the silly little
\r
100 path/value parser to get confused.</para>
\r
102 <para>Section ToCs are further controlled by the
\r
103 <parameter>generate.section.toc.level</parameter> parameter.
\r
104 For a given section level to have a ToC, it must have both an entry in
\r
105 <parameter>generate.toc</parameter> and be within the range enabled by
\r
106 <parameter>generate.section.toc.level</parameter>.</para>
\r