[PATCH xorg-sgml-doctools] ToC on separate page in pdfs.

Gaetan Nadon memsize at videotron.ca
Sat Dec 31 17:28:28 PST 2011

On 11-12-31 04:37 PM, Matt Dew wrote:
> In the PDFs and postscript files docs,  the Table of Contents should be on its own page if the
> doctype='article'. This matches the behavior with doctype='book' documents.
> ---
>  xorg-fo.xsl |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> diff --git a/xorg-fo.xsl b/xorg-fo.xsl
> index d57f7ac..4ce8acd 100644
> --- a/xorg-fo.xsl
> +++ b/xorg-fo.xsl
> @@ -84,4 +84,11 @@
>    <xsl:param name="body.font.family">DejaVu Serif</xsl:param>
>    <xsl:param name="symbol.font.family">serif,Symbol,AR PL UMing CN,AR PL ShanHeiSun Uni,GNU Unifont</xsl:param>
> +  <!-- put page breaks before and after the Table of Contents,
> +       so that the ToC is on a page by itself  -->
> +  <xsl:attribute-set name="toc.margin.properties">
> +    <xsl:attribute name="break-before">page</xsl:attribute>
> +    <xsl:attribute name="break-after">page</xsl:attribute>
> +  </xsl:attribute-set>
> +
>  </xsl:stylesheet>
It works for me as well. A couple of things to do:

The attribute names are not listed in
http://docbook.sourceforge.net/release/xsl/current/doc/fo/ listed at the
top of the xorg-fo.xsl.
Where were these documented?
Does it prereq a certain version of docbook xsl?

Rather than appending the new code at the end of the file, which would
break the current style, could you move it under a new heading called
"ToC/LoT/Index Generation" at line 34?

I don't know if you have noticed, I wrote the xsl file by following the
"Part 2. FO Parameter Reference" classification so a reader can easily
put the code in context of the documentation.

More information about the xorg-devel mailing list