XML technologies / DocBook / Generating FO (PDF) / Displaying tables of contents / Full-width tables of contents
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
To align page numbers with the right margin, add further attributes to the fo:block in Chapter table of contents at the text width.
<fo:block space-before="0.75em" end-indent="2.5em" last-line-end-indent="-2.5em" text-align="center" text-align-last="justify">
<fo:basic-link internal-destination="{$id}">
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</fo:basic-link>
<fo:leader leader-pattern="space"/>
<fo:basic-link internal-destination="{$id}">
<fo:page-number-citation ref-id="{$id}" />
</fo:basic-link>
</fo:block>Line 1: last-line-end-indent – shifts the right block boundary to leave space between overflowing text and the right margin. text-align – sets the alignment. The attribute text-align-last is particularly important for filling the line area with fo:leader.
Line 5: the leader element, using whitespace here.
Note that this makes the text area narrower. This helps prevent the reader’s eye from accidentally following the wrong line.
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