OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: RE: [docbook-apps] Customizing TOC title and fonts for print output

> -----Original Message-----
> From: lowry123 
> Currently I have a TOC for the book, which lists only 
> Chapters, and then a
> TOC for each Chapter which lists the sections. One thing I am 
> trying to do
> is center the "Table of Contents" title for each TOC, instead of
> left-justified. 

You can add a text-align="center" attribute to the title by modifying the
title page specification file. 

See http://www.sagehill.net/docbookxsl/PrintToc.html#TocTitle and

> I would also like for the TOC for the book to 
> have "Main
> Table of Contents" as the title while the chapter TOCs have "Table of
> Contents".

The title page specification file does not allow any conditional logic. But
you can copy the generated template (see above) to your customization layer
and adjust it so that it handles both the centering of the title and the
choice of title text:  

<xsl:template name="table.of.contents.titlepage.recto">
  <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"; 


      <xsl:when test="self::book">Main Table of Contents</xsl:when>
       <xsl:call-template name="gentext">
	  <xsl:with-param name="key" select="'TableofContents'"/>

> Also, I would like to be able to customize the fonts. For 
> example, in the
> Chapter TOCs, I would like to have the lines for level1 sections to be
> normal, while the lines for level2, level3... sections are italic. 

Something like this should work:

<xsl:attribute-set name="toc.line.properties">
  <xsl:attribute name="font-style">
      <xsl:when test="self::section[parent::section]">italic</xsl:when>

See http://www.sagehill.net/docbookxsl/PrintToc.html#PrintTocEntries 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]