This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] Indent lists from column margin
[New subject line so as to make archive searching easy.]
Bob Stayton's suggested technique for indenting lists (below) works
quite well for me in print docs. It's a valuable little snippet.
> > 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/.
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.