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 Jon Steeves <Jo...@pmc-sierra.com> on 2003/01/23 21:58:27 UTC
Table of Contents problem
Hello:
I'm trying to generate a TOC. The following code works up to a point - all the TOC items output correctly except for the last one, which won't print the page number at the end of the leader pattern.
Does anyone know how to get that last page number to print? (Also, does anyone know how to get the leader pattern to output evenly?)
Here's the code:
<xsl:template match="register" mode="toc">
<fo:block font-size="9pt" text-align-last="justify">
<xsl:value-of select="reg_name"/>
<fo:leader leader-pattern="dots"/>
<fo:page-number-citation ref-id="{generate-id(.)}"/>
</fo:block>
</xsl:template>
Here's what it outputs:
Table of Contents
Control Register.........................................................4
ECCConfiguration.....................................................5
ECCInterrupt.............................................................6
ECCAddress..............................................................7
BIST Control Register................................................8
BIST Result Register..................................................
Cheers
Jon Steeves
(604) 415-6053 ext. 2139
jon_steeves@pmc-sierra.com
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Table of Contents problem
Posted by Magnus Sjöberg <ma...@secode.com>.
Also, (which of course depends on your type of document),
try to use a page-sequence per chapter or section.
I also had that last id in my ToC mysteriously disappearing,
until I set up a page-sequence per chapter.
Since the page-number-citation refers to the title in the
chapter, it lies first in the flow and this seemed to help,
at least for me.
hth
///Magnus
"J.Pietschmann" wrote:
>
> Jon Steeves wrote:
> > I'm trying to generate a TOC. The following code works up to a point - all
> > the TOC items output correctly except for the last one, which won't print the
> > page number at the end of the leader pattern.
> >
> > Does anyone know how to get that last page number to print?
>
> Looks like one of these elusive "deleted Id" bugs. Are you
> using a multi-column layout or keeps, or lists?
> An id referred to should be on a fo:block which is not nested
> in a list or table, and for best results on a block which is
> an immediate child of the flow.
>
> > (Also, does
> > anyone know how to get the leader pattern to output evenly?)
> There is currently no way to make it perfect, but you can improve
> it a bit with a table
> <fo:table table-layout="fixed" widht="100%">
> <fo:table-column column-width="proportional-column-width(5)"/>
> <fo:table-column column-width="proportional-column-width(1)"/>
> <fo:table-body>
> <fo:table-row>
> <fo:table-cell>
> <fo:block text-align="justify">Text <fo:leader leader-pattern="dots"/>
> </fo:block>
> </fo:table-cell>
> <fo:table-cell>
> <fo:block text-align="right">
> <fo:leader leader-pattern="dots"/><fo:page-number-citation .../>
> </fo:block>
> </fo:table-cell>
> </fo:table-row>
> </fo:table-body>
> </fo:table>
> Note: there must be a space before the leader in the first cell, and there
> must not be a space between the leader in the second cell and the page number
> citation.
> The leader form the second cell will probably overlap the other leader. You
> might need to adjust the cell width a bit so that the dots match exactly.
>
> J.Pietschmann
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Table of Contents problem
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jon Steeves wrote:
> I'm trying to generate a TOC. The following code works up to a point - all
> the TOC items output correctly except for the last one, which won't print the
> page number at the end of the leader pattern.
>
> Does anyone know how to get that last page number to print?
Looks like one of these elusive "deleted Id" bugs. Are you
using a multi-column layout or keeps, or lists?
An id referred to should be on a fo:block which is not nested
in a list or table, and for best results on a block which is
an immediate child of the flow.
> (Also, does
> anyone know how to get the leader pattern to output evenly?)
There is currently no way to make it perfect, but you can improve
it a bit with a table
<fo:table table-layout="fixed" widht="100%">
<fo:table-column column-width="proportional-column-width(5)"/>
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block text-align="justify">Text <fo:leader leader-pattern="dots"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right">
<fo:leader leader-pattern="dots"/><fo:page-number-citation .../>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
Note: there must be a space before the leader in the first cell, and there
must not be a space between the leader in the second cell and the page number
citation.
The leader form the second cell will probably overlap the other leader. You
might need to adjust the cell width a bit so that the dots match exactly.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org