You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Michal Kwiatek <mi...@BiznesPartner.pl> on 2002/04/09 13:10:09 UTC

tabulation

Hi!

I need to enter a TOC into my document. Titles should be left-aligned, but
numbers of pages must be right-aligned, although they're in the same lines,
as titiles. There should also be dots between titles and page numbers.

I looked for tabulators in xsl specs, but there seem to be none. So there
has to be some other way! Any ideas?

I know this isn't strictle a fop question, but you're the only active xsl fo
community I've heard of.

Thanks in advance,
Michal Kwiatek


Re: tabulation

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Michal Kwiatek wrote:
> I need to enter a TOC into my document. Titles should be left-aligned, but
> numbers of pages must be right-aligned, although they're in the same lines,
> as titiles. There should also be dots between titles and page numbers.
> 
> I looked for tabulators in xsl specs, but there seem to be none. So there
> has to be some other way! Any ideas?

In general, if you think on tabulators, try to translate it into
tables first.
The following comes pretty close:
         <fo:table-body>
           <fo:table-row>
             <fo:table-cell>
               <fo:block>1. Foo Chapter<fo:leader leader-pattern="dots"/></fo:block>
             </fo:table-cell>
             <fo:table-cell text-align="end">
               <fo:block><fo:leader leader-pattern="dots"/>1</fo:block>
             </fo:table-cell>
           </fo:table-row>
           <fo:table-row>
             <fo:table-cell>
               <fo:block>2. Bar Chapter Lorem<fo:leader leader-pattern="dots"/></fo:block>
             </fo:table-cell>
             <fo:table-cell text-align="end">
               <fo:block><fo:leader leader-pattern="dots"/>22</fo:block>
             </fo:table-cell>
           </fo:table-row>
         </fo:table-body>
       </fo:table>
(Insert your page-number-citations appropriately)
Of course, you'll have to work a bit that none of your columns
overflow, and there could be an artifact in your leader, even
though i never met one.
Don't worry about a rugged right margin, that's a known
deficiency with page number forward references.

It's interesting to see that
       <fo:block text-align="end">1.&#160;Foo&#160;Chapter<fo:leader
          leader-pattern="dots"/>1</fo:block>
*almost* works too. :-)

J.Pietschmann