XML technologies / DocBook / Generating (X)HTML / Generating tables of contents / Numbering chapters and sections
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
By default, parts and chapters are numbered, but sections are not. Stylesheet parameters control numbering. The value 1 enables the parameter; the value 0 disables it.
Table: Numbering parameters
Parameters | Description |
| controls automatic part numbering; the default is |
| controls automatic chapter numbering; the default is |
| controls automatic preface numbering; the default is |
| controls automatic appendix numbering; the default is 1 |
| controls automatic section numbering; the default is |
| controls automatic numbering within the section’s component; the default is |
| controls automatic numbering of |
| If this parameter is set to |
The following examples show the effects and interaction of these parameters.
With unchanged parameters, a book with these chapters produces the following numbering:
<!-- Standard -->
Vorwort
I. Grundlagen
1. Einführung in XML
Geschichtliches zu SGML, HTML und XML
XML in 10 Punkten
Geschichtliches zu SGML, HTML und XML
II. Dokumentmodelle
2. Dokumententyp-Definitionen
Vergleich zwischen DTDs und Schemata
Aufbau einer DTD
Geschichtliches zu SGML, HTML und XML
A. Schnellübersicht über die DocBook-ElementeThe parameter label.from.part is set to 1:
<!-- label.from.part=1 -->
Vorwort
I. Grundlagen
1. Einführung in XML
Geschichtliches zu SGML, HTML und XML
XML in 10 Punkten
Geschichtliches zu SGML, HTML und XML
II. Dokumentmodelle
1. Dokumententyp-Definitionen
Vergleich zwischen DTDs und Schemata
Aufbau einer DTD
Geschichtliches zu SGML, HTML und XML
A. Schnellübersicht über die DocBook-ElementeCompared with the preceding output, chapter numbering restarts at 1.
To number sections too, use these parameters:
<!-- label.from.part=1, section.autolabel=1 -->
Vorwort
I. Grundlagen
1. Einführung in XML
1. Geschichtliches zu SGML, HTML und XML
2. XML in 10 Punkten
3. Geschichtliches zu SGML, HTML und XML
II. Dokumentmodelle
1. Dokumententyp-Definitionen
1. Vergleich zwischen DTDs und Schemata
2. Aufbau einer DTD
3. Geschichtliches zu SGML, HTML und XML
A. Schnellübersicht über die DocBook-ElementeSections are now numbered too. To include the chapter number, use:
<!-- section.label.includes.component.label=1,
section.autolabel=1 -->
Vorwort
I. Grundlagen
1. Einführung in XML
1.1. Geschichtliches zu SGML, HTML und XML
1.2. XML in 10 Punkten
1.3. Geschichtliches zu SGML, HTML und XML
II. Dokumentmodelle
2. Dokumententyp-Definitionen
2.1. Vergleich zwischen DTDs und Schemata
2.2. Aufbau einer DTD
2.3. Geschichtliches zu SGML, HTML und XML
A. Schnellübersicht über die DocBook-ElementeTry the other parameters as an exercise.
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top