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

Matt Dew marcoz at osource.org
Sun Jan 1 13:16:59 PST 2012


On 12/31/2011 06:28 PM, Gaetan Nadon wrote:
> 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?

I found them on the sagehill site:
http://www.sagehill.net/docbookxsl/PrintToc.html

> Does it prereq a certain version of docbook xsl?

Not that I can determine. To be safe I installed 1.70.1 and tried it. 
(XML_DEBUG_CATALOG=1 showed it was being picked up as expected.)
Works fine.

>
> 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?

Done.

>
> 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.

I noticed a while back that you'd been grouping things but it didn't 
dawn on me that it belonged under "Pagination and General Styles FO 
Parameters".  It's good there's a review process, it's there now.


Matt


More information about the xorg-devel mailing list