XML technologies / DocBook / Generating FO (PDF) / Formatting headings / Customizing with attribute sets
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
The easiest way to customize headings is to populate attribute sets. The DocBook FO stylesheets distinguish between left-hand (verso) and right-hand (recto) pages. The attribute sets for an element are therefore named ELEMENT ELEMENT.titlepage.recto.style and ELEMENT.titlepage.verso.style, depending on the side on which the heading appears.
For example, the following attribute sets are defined for a book title (file fo/titlepage.xsl):
Example: Attribute sets for a book title on left- and right-hand pages
<xsl:attribute-set name="book.titlepage.recto.style">
<xsl:attribute name="font-family">
<xsl:value-of select="$title.fontset"/>
</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="font-size">12pt</xsl:attribute>
<xsl:attribute name="text-align">center</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="book.titlepage.verso.style">
<xsl:attribute name="font-size">10pt</xsl:attribute>
</xsl:attribute-set>This distinction is necessary for a book title: it appears in a larger font on the title page and a smaller font in the imprint. Where the distinction is unnecessary, the attribute sets are empty. The following code doubles the book title’s font size on the right-hand page:
<xsl:attribute-set name="book.titlepage.recto.style">
<xsl:attribute name="font-size">24pt</xsl:attribute>
</xsl:attribute-set>All other attributes retain their original definitions.
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