[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Setting book toc.indent.width for sect1
Problem solved. I realized that when I added parts to a book, the
toc.indent.width value was doubled for the section entries - it's
cumulative. I found the right template that affects the
toc.indent.width for chapters, and needed to customize it for books
both with and without parts. Here is my code (with a new variable
"toc.indent.width.sections" expressed in points, which provides left
margin for all section, sect1, etc... titles): <xsl:template match="d:preface|d:chapter|d:appendix|d:article" mode="toc"> <xsl:param name="toc-context" select="."/> ... <xsl:if test="$toc.section.depth > 0 and $toc.max.depth > $depth.from.context and $nodes"> <!--reset toc width for sections (flush left margin): 13/10/12--> <xsl:choose> <!--for book with parts: OK 14/10/12--> <xsl:when test="parent::d:part"> <fo:block id="toc.{$cid}.{$id}" margin-left="-{$toc.indent.width}pt+{$toc.indent.width.sections}pt"> <!--<xsl:attribute name="margin-{$direction.align.start}"> <xsl:call-template name="set.toc.indent"/> </xsl:attribute>--> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:when> <!--for book with no parts: OK 14/10/12--> <xsl:otherwise> <fo:block id="toc.{$cid}.{$id}" margin-left="{$toc.indent.width.sections}pt"> <!--<xsl:attribute name="margin-{$direction.align.start}"> <xsl:call-template name="set.toc.indent"/> </xsl:attribute>--> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:template> On 13-10-12 6:33 PM, Xmplar wrote:
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]