This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Strange behaviour for nested, ordered lists?


----- Original Message ----- 
From: "Steve Whitlatch" <swhitlat@getnet.net>
To: <docbook-apps@lists.oasis-open.org>; "Derek Hohls" <DHohls@csir.co.za>
Sent: Friday, January 30, 2004 6:36 PM
Subject: [docbook-apps] Strange behaviour for nested, ordered lists?

[stuff deleted]

> Anyone know how to cause lists to be indented from the column margin?
>
> That would be:
>
>    text . . .
>    text . . .
>    text . . .
>    text . . .
>    text . . .
>    text . . .
>        listitem_text . . .
>        listitem_text . . .
>           nested_list_item_text . . .
>           nested_list_item_text . . .
>           nested_list_item_text . . .
>        listitem_text . . . .
>        listitem_text . . . .
>    text . . . .
>    text . . . .

A customization such as the following would do it.  It creates a wrapper
fo:block with a margin-left property, and then uses apply-imports to
use the regular templates for formatting the list inside the block.  The
test for
an ancestor list is done to avoid applying the
indent to nested lists, which are already indented by the containing list.
Otherwise they would get both indents.

<xsl:template match="orderedlist|itemizedlist">
  <xsl:choose>
    <xsl:when test="not(ancestor::itemizedlist or ancestor::orderedlist)">
      <fo:block margin-left="0.25in">
        <xsl:apply-imports/>
      </fo:block>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-imports/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net



To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]