docbook-apps message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Re: [docbook-apps] list of figures in the TOC for an appendix
- From: Ron Catterall <ron@catterall.net>
- To: docbook-apps@lists.oasis-open.org
- Date: Wed, 11 Apr 2007 08:12:24 -0500
Title: Re: [docbook-apps] list of figures in the TOC for
an appen
Hi Andreas
The code you tried needs to be
embedded in the template match="appendix" copied from the
standard XSL stylesheet. You also need to ask for the TOC with
the <xsl:param name"generate.toc"> parameter.
Below is a copy direct from my present stylesheet customization, and
works OK for me today. The bit you tried is now embedded in the
system template match="appendix", near the bottom, 2 or 3
up. The first four of the templates are the standard null
ones.
Bob Stayton wrote
>>>
Hi Ron,
Lists of figures, tables, etc. is
only implemented for the book element. I think perhaps it was
intended to be extended to other elements, but never was.
I think it might be as easy as
adding something like this to an appendix customization:
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles"
select="'figure'"/>
<xsl:with-param name="nodes"
select=".//figure"/>
</xsl:call-template>
>>>
Hope this helps.
Ron
<!-- generate tables of
contents for book, preface, parts chapters and appendices
-->
<!-- List of Figures removed
for this project from "book
toc,title,table,figure,example,equation" -->
<!-- List of toc,title removed
for this project from "appendix toc,title"
-->
<xsl:param name="generate.toc" >
appendix toc,title,figure
article toc,title
book toc,title
chapter toc,title
part toc,title
preface title
reference toc,title
sect1 title
sect2 title
sect3 title
sect4 title
sect5 title
section title
</xsl:param>
<xsl:template match="appendix/docinfo|appendixinfo"></xsl:template>
<xsl:template match="appendix/title"></xsl:template>
<xsl:template match="appendix/titleabbrev"></xsl:template>
<xsl:template match="appendix/subtitle"></xsl:template>
<xsl:template match="appendix">
<xsl:variable
name="id">
<xsl:call-template
name="object.id"/>
</xsl:variable>
<xsl:variable
name="master-reference">
<xsl:call-template
name="select.pagemaster"/>
</xsl:variable>
<fo:page-sequence
hyphenate="$hyphenate"
master-reference="$master-reference">
<xsl:attribute
name="language">
<xsl:call-template
name="l10n.language"/>
</xsl:attribute>
<xsl:attribute
name="format">
<xsl:call-template
name="page.number.format">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute
name="initial-page-number">
<xsl:call-template
name="initial.page.number">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute
name="force-page-count">
<xsl:call-template
name="force.page.count">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute
name="hyphenation-character">
<xsl:call-template
name="gentext">
<xsl:with-param name="key"
select="'hyphenation-character'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute
name="hyphenation-push-character-count">
<xsl:call-template
name="gentext">
<xsl:with-param name="key"
select="'hyphenation-push-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute
name="hyphenation-remain-character-count">
<xsl:call-template
name="gentext">
<xsl:with-param name="key"
select="'hyphenation-remain-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates
select="."
mode="running.head.mode">
<xsl:with-param
name="master-reference" select="$master-reference"/>
</xsl:apply-templates>
<xsl:apply-templates
select="."
mode="running.foot.mode">
<xsl:with-param
name="master-reference" select="$master-reference"/>
</xsl:apply-templates>
<fo:flow
flow-name="xsl-region-body">
<xsl:call-template name="set.flow.properties">
<xsl:with-param name="element" select="local-name(.)"/>
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:call-template>
<fo:block id="$id">
<xsl:call-template name="appendix.titlepage"/>
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'figure'"/>
<xsl:with-param name="nodes" select=".//figure"/>
</xsl:call-template>
</fo:block>
<xsl:variable
name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params,
'title')"/>
</xsl:call-template>
<xsl:call-template name="component.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</xsl:template>
Hi Ron,
I was searching for a possibility to add a list of figures to my docbook article. I found that you just had the same problem and you
found following solution:
<!-- list.of.titles code added to template match="appendix" to generate a list of figures at start of an appendix -->
<fo:block id="$id">
<xsl:call-template name="appendix.titlepage"/>
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'figure'"/>
<xsl:with-param name="nodes" select=".//figure"/>
</xsl:call-template>
</fo:block>
I'm pretty new to docbook and docbook stylesheets. I could not
find the right place to add those lines. I tried to add them to my
customization file, but it did not work. Where do I add this template,
or which original template do I have to change?
I hope you can help me.
Greetings
Andreas Post
--
Ron Catterall, Phd, DSc
email: ron@catterall.net
Prolongacion de Hidalgo 140
http://catterall.net/
San Felipe del Agua
tel:
+52 951 520 1821
Oaxaca 68020
Mexico
fax:
+1 530 348 8309
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]