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] toc generation in fo and html


Hi Holger,
Although the HTML TOC hierarchy is what you seek, it is the one with the
bug.  When toc.section.depth is set 1, section level 2 titles should not
appear in any TOC.  With the parameter settings you have for HTML, you
should not get the section TOC containing 4.3.1 et al, because those are
level 2 sections.

The FO side is working correctly, although there is no combination of
parameters that will give you the TOC hierarchy you seek.  A small
customization can be added though.

I used these parameter settings for FO:

<xsl:param name="generate.section.toc.level" select="1"/>
<xsl:param name="toc.section.depth" select="2"/>
<xsl:param name="toc.max.depth" select="1"/>
<xsl:param name="generate.toc">
book      toc,title,figure,table,example,equation
chapter  toc
sect1    toc
section  toc
</xsl:param>

Setting toc.max.depth to 1 would normally mean only one level of title in
each toc, which works for the TOCs in chapters and sections, but not the
book toc. So I copied and modified the template that starts with this line
from fo/autotoc.xsl:

<xsl:template match="preface|chapter|appendix|article"  mode="toc">

and changed the xsl:if  test from:

  <xsl:if test="$toc.section.depth > 0
                and $toc.max.depth > $depth.from.context
                and $nodes">

to:

  <xsl:if test="$toc.section.depth > 0
                and $toc.max.depth + 1 > $depth.from.context
                and $nodes">

This permits an extra level of section under the chapter titles in the book
toc.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Holger Morch" <morch@osiag.de>
To: <docbook-apps@lists.oasis-open.org>
Sent: Friday, January 13, 2006 7:17 AM
Subject: [docbook-apps] toc generation in fo and html


> Hi,
>
> I try to generate a html and a similar pdf file. The generation of the
> toc's seems to be different in html and pdf. The html Version is what I
> want.
> I use docbook-xsl-1.69.1 and saxon 6.5.4.
>
> My html toc properties are:
> <xsl:param name="generate.section.toc.level" select="1"/>
> <xsl:param name="toc.section.depth" select="1"/>
> <xsl:param name="section.autolabel" select="1"/>
> <xsl:param name="section.autolabel.max.depth" select="2"/>
> <xsl:param name="section.label.includes.component.label" select="1"/>
>
> The generated toc's are:
>
> book toc:
> 1. [title]
> 2. [title]
> 3. [title]
>      3.1. [title]
>      3.2. [title]
>      3.3. [title]
> 4. [title]
>      4.1. [title]
>      4.2. [title]
>      4.3. [title]
> etc.
>
> chapter toc (number 4. in book toc):
> 4.1. [title]
> 4.2. [title]
> 4.3. [title]
>
> section toc (number 4.3. in book and chapter toc):
> 4.3.1. [title]
> 4.3.2. [title]
> 4.3.3. [title]
> 4.3.4. [title]
> 4.3.5. [title]
> 4.3.6. [title]
>
>
> My pdf toc properties are:
> <xsl:param name="generate.section.toc.level" select="1"/>
> <xsl:param name="toc.section.depth" select="2"/>
> <xsl:param name="toc.max.depth">2</xsl:param>
> <xsl:param name="section.autolabel" select="1"/>
> <xsl:param name="section.autolabel.max.depth" select="2"/>
> <xsl:param name="section.label.includes.component.label" select="1"/>
>
> The generated toc's are:
>
> book toc:
> 1. [title]...[page]
> 2. [title]...[page]
> 3. [title]...[page]
> 3.1. [title]...[page]
> 3.2. [title]...[page]
> 3.3. [title]...[page]
> 4. [title]...[page]
> 4.1. [title]...[page]
> 4.2. [title]...[page]
> 4.3. [title]...[page]
> etc.
>
> chapter toc (number 4. in book toc):
> 4.1. [title]...[page]
> 4.2. [title]...[page]
> 4.3. [title]...[page]
> 4.3.1. [title]...[page]
> 4.3.2. [title]...[page]
> 4.3.3. [title]...[page]
> 4.3.4. [title]...[page]
> 4.3.5. [title]...[page]
> 4.3.6. [title]...[page]
>
> section toc (number 4.3. in book and chapter toc):
> 4.3.1. [title]...[page]
> 4.3.2. [title]...[page]
> 4.3.3. [title]...[page]
> 4.3.4. [title]...[page]
> 4.3.5. [title]...[page]
> 4.3.6. [title]...[page]
>
> As you can see in pdf the sub sections 4.3.x. are included in chapter
> level toc, in html they aren't. If I set toc.max.depth to more then two
> they are in the book toc, too.
> It seems that html calculates toc.section.depth depending on the level
> of the toc. In book and chapter only the first level sections are in
> toc. In the first level section only the second is included.
> PDF on the other hand always include the same number of section levels
> in all toc's (2 in this example). This can only be limited by
toc.max.depth.
>
> Is this behavior as it should be? Am I doing something wrong?
>
> Regards
> Holger Morch
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
>




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