[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Make dedication element appear in TOC
-----Original Message-----
From: "redlettucemail" <redlettucemail@mailscan.acenet.net.au>
To: docbook-apps@lists.oasis-open.org
Date: Mon, 19 Sep 2011 18:23:16 +1000
Subject: Re: [docbook-apps] Make dedication element appear in TOC
Thanks so far Bob - I got the dedication element to appear in the TOC (“Executive summary” and “Acknowledgments”) but now I’m getting the page number of the Glossary (page 103). What code controls the page numbering then (is it toc.title.p)? Here is my customisation:<xsl:template name="division.toc">
<xsl:param name ="toc-context" select ="."/>
<xsl:param name ="toc.title.p" select ="true()"/>
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="nodes"
select= "$toc-context/d:part
|$toc-context/d:reference
|$toc-context/d:dedication
|$toc-context/d:preface
|$toc-context/d:chapter
|$toc-context/d:appendix
|$toc-context/d:article
|$toc-context/d:bibliography
|$toc-context/d:glossary
|$toc-context/d:index"/>
<xsl:if test ="$nodes">
<fo:block id ="toc...{$cid}"
xsl:use-attribute-sets="toc.margin.properties">
<xsl:if test="$axf.extensions != 0">
<xsl:attribute name="axf:outline-level">1 </xsl:attribute>
<xsl:attribute name="axf:outline-expand">false </xsl:attribute>
<xsl:attribute name="axf:outline-title">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'TableofContents'"/>
</xsl:call-template>
</xsl:attribute>
</xsl:if>
<xsl:if test="$toc.title.p">
<xsl:call-template name="table.of.contents.titlepage"/>
</xsl:if>
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
<xsl:template match="d:dedication" mode="toc">
<xsl:param name ="toc-context" select ="."/>
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>Dave Gardiner
-----Original Message-----
From: "Bob Stayton" <bobs@sagehill.net>
To: "redlettucemail" <redlettucemail@mailscan.acenet.net.au>, <docbook-apps@lists.oasis-open.org>
Date: Sun, 18 Sep 2011 20:51:43 -0700
Subject: Re: [docbook-apps] Make dedication element appear in TOC
Hi Dave,I think you also need to add a template with match="d:dedication" mode="toc", as for other elements (see examples in autotoc.xsl). There is no match="*" for mode="toc" to catch new elements.----- Original Message -----From: redlettucemailSent: Sunday, September 18, 2011 7:56 PMSubject: [docbook-apps] Make dedication element appear in TOCHow do I customise the stylesheets so that the “dedication” element appears in the generated TOC? It appears that this and “acknowledgments” are the only elements that are not extracted to a TOC.I thought I had found the right code with <xsl:template name="division.toc"> in autotoc.xsl. I added $toc-context/d:dedication to variable “nodes” – but all that did was copy the entire contents of my “dedication” chunk to the TOC. It didn’t create the title with a leader line and page number.Thanks,Dave Gardiner
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]