W3C home > Mailing lists > Public > www-xsl-fo@w3.org > November 2001

Re: xsl:fo and tabulations

From: Kenneth J. Hughes <kjh@entel.com>
Date: Wed, 14 Nov 2001 14:06:07 -0500
Message-Id: <5.1.0.14.0.20011114135630.02f28dc8@entel.com>
To: Laurent Vaills <laurent.vaills@laposte.net>, www-xsl-fo@w3.org
At 05:23 AM 11/14/2001 -0500, Laurent Vaills wrote:
>Hi. 
>
>I want to be able, for example to generate a table of contents like this
>one : (best view with a fixed font)
>Chapter 1.................................1
>  Section 1...............................2
>    Subsection 1..........................3
>    Subsection 2..........................4
> 
>With all the page numbers aligned on the right. 
>Most word processors do this by inserting a tabulation between the text
>and the page numbers and we can choose whatever we want instead of the
>dots.
>I've watched the fo:leader and the examples of FOP but it doesn't suit
>my needs because the page numbers are not aligned to the right.
>
>Is there a way to do this with xsl:fo ?

Hi Laurent,

The following construct should suit your needs, aligning the page numbers
to the right, leading with dots, and giving you control over indentation:

<fo:block text-align-last="justify" end-indent="2pc" last-line-end-indent="-2pc">
  <fo:inline keep-with-next.within-line="always">Chapter 1</fo:inline>
  <fo:inline keep-together.within-line="always">
    <fo:leader leader-pattern="dots" keep-with-next.within-line="always"/>
    1
  </fo:inline>
</fo:block>

Cheers,

Kenneth J. Hughes                                        kjh@entel.com
Entelechy Corporation                            http://www.entel.com/ 
Received on Wednesday, 14 November 2001 14:04:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:08 GMT