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] List of titles within table of contents


Hi Marius,
Your basic assessment of the problem is correct, the list of figures is not a node in the document that can be processed like section.  I would suggest a customization along these lines:
 
1.  Customize the template named 'component.toc' from fo/autotoc.xsl to add a call to a new template for your new TOC item:
 
  ...
  <xsl:if test="$nodes">
    <fo:block id="toc...{$id}"
              xsl:use-attribute-sets="toc.margin.properties">
      <xsl:if test="$toc.title.p">
        <xsl:call-template name="table.of.contents.titlepage"/>
      </xsl:if>
 
      <!-- Add something like this line here -->
      <xsl:call-template name="figure.list.toc.line"/>

      <xsl:apply-templates select="$nodes" mode="toc">
        <xsl:with-param name="toc-context" select="$toc-context"/>
      </xsl:apply-templates>
    </fo:block>
  </xsl:if>
2.  Then create a new template by that name by copying the template named 'toc.line', which handles generating one line in a TOC.  In that customized template, you will need to customize the variable named 'id' to match the id of the fo:block containing the list of figures, as it is generated in the 'list.of.titles' template:
 
  <fo:block id="lot...{$titles}...{$id}"
 
where $titles in your case is 'figure'.  The $id reference will still be good, because the context is still the article element.  So your custom template would have:
 
<xsl:variable name="id">
  <xsl:text>lot...figure...</xsl:text>
  <xsl:call-template name="object.id"/>
</xsl:variable>
 
Then you need to replace the line that applies templates in mode="titleabbrev.markup" with a call to gentext:
 
<xsl:call-template name="gentext">
  <xsl:with-param name="key">ListofFigures</xsl:with-param>
</xsl:call-template>
 
I haven't tested this, but that should get you started.
 
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

Sent: Wednesday, January 30, 2013 7:45 AM
Subject: [docbook-apps] List of titles within table of contents

Hello,

I tried to find a way to have the title of list of figures within the table of contents. I guess the main problem is I do not have a node-name for the list of figures. Perhaps I am completely wrong with this guess. However I feel lost somewhere inbetween make.component.tocs, component.toc and component.list.of.titles.

The document is an article, the output is pdf and the stylesheet version is 1.77.1.

I expect the result to be as follows:

TOC

List of Figures ...
Section 1 ...
Section 2 ...
etc.

Any kind of help would be appreciated.

Best regards,

Marius


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