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.margin.properties, end-indent, no affect

There are a couple of ways to handle lots and tocs differently.  Since you 
are already customizing the toc.line template, you could make the 
start-indent attribute conditional.  The context node when toc.line is 
called is the element whose title is being formatted.  So you could do 
something like this:

  <fo:block xsl:use-attribute-sets="toc.line.properties"
    <xsl:if test="self::figure or self::table or self::example or 
self::equation or self::procedure">
      <xsl:attribute name="start-indent">0pt</xsl:attribute>

I also noticed that autotoc.xsl calls toc.line using this simple template 
for figures, etc:

<xsl:template match="figure|table|example|equation|procedure" mode="toc">
  <xsl:call-template name="toc.line"/>

You could wrap that call in another block with the start-indent:

<xsl:template match="figure|table|example|equation|procedure" mode="toc">
  <fo:block start-indent="0pt">
    <xsl:call-template name="toc.line"/>

Bob Stayton
Sagehill Enterprises
DocBook Consulting

----- Original Message ----- 
From: "Steve Whitlatch" <swhitlat@getnet.net>
To: "Bob Stayton" <bobs@sagehill.net>; <docbook-apps@lists.oasis-open.org>
Sent: Monday, July 24, 2006 12:43 PM
Subject: Re: [docbook-apps] toc.margin.properties, end-indent, no affect

> Thanks Bob,
>> The end-indent value adds a right margin for all lines, and the
>> last-line-end-indent adds a negative value to cancel it out for the last
>> line.  That way if a toc line is long and wraps, the first line does not
>> intrude into the space reserved for the page numbers.  You would need:
>>  <fo:block text-align-last="justify"
>>            end-indent="2.5in + {$toc.indent.width}pt"
>>            last-line-end-indent="-{$toc.indent.width}pt">
> That works. I copied the example toc.line template from your book and
> added an
>  end-indent="1.0in + {$toc.indent.width}pt"
> line to its enclosed <fo:block . . . > element. That end-indent setting
> controls the right indent for both the TOC and the LOTs (List of Tables,
> List of Figures, etc.).
> Can you tell me how to control the start-indent for LOTs, and would the
> DocBook XSL FO stylesheets benefit from an lot.line template? I ask 
> because
> it seems that some of the TOC and LOT formatting is mixed in the same 
> code
> and some is not. I'm not sure. Here's what I found.
> I am using
>  <xsl:attribute name="start-indent">0.0in</xsl:attribute>
> within a toc.margin.properties attribute-set to temporarily negate the
> body.start.indent value for formatting lines in the TOC. But that setting 
> only
> overrides the start-indent value for TOC lines, not LOT lines.
> Since an end-indent value within the toc.line template's <fo:block . . . 
>  >
> worked to set the end-indent on both the TOC and LOTs, I tried a
>  start-indent="0.0in"
> value in the same <fo:block . . . > in an effort to set the start-indent 
> for
> both the TOC and LOTs. That has an affect, but it is not what I expected. 
> It
> does move the LOTs' lines to the left margin, but it also neutralizes the
> indenting on the TOC's lines for each sub-section and sub-sub-section. 
> All
> the TOC's lines get moved to the left margin.
> An attempt to summarize:
> I've got the right-hand indent set corectly and working for lines in both 
> the
> TOC and the LOTs. Now, I want to neutralize the body.start.indent value 
> that
> apparently gets applied to both. I can neutralize the body.start.indent 
> value
> for TOCs with a toc.margin.properties attribute-set child element of
>  <xsl:attribute name="start-indent">0.0in</xsl:attribute>
> Good so far, but how do I do the same for LOTs without destroying the 
> TOC's
> indenting of lines for sub-sections and sub-sub-sections?
> Thanks,
> Steve Whitlatch

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