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
http://www.sagehill.net/docbookxsl/TitlePagePrint.html


> 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:use-attribute-sets="table.of.contents.titlepage.recto.style"

	    text-align="center"
	    space-before.minimum="1em" 
	    space-before.optimum="1.5em" 
	    space-before.maximum="2em" 
	    space-after="0.5em" 
	    margin-left="{$title.margin.left}" 
	    start-indent="0pt" 
	    font-size="17.28pt" 
	    font-weight="bold" 
	    font-family="{$title.fontset}">

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

 
> 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:choose>
      <xsl:when test="self::section[parent::section]">italic</xsl:when>
      <xsl:otherwise>normal</xsl:otherwise>
    </xsl:choose>
  </xsl:attribute>
</xsl:attribute-set>

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

/MJ







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