This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
RE: Page number in ToC
- From: Nicolas Nieswandt <Nicolas dot N at gmx dot de>
- To: Jeff Beal <jeff dot beal at ansys dot com>, docbook-apps at lists dot oasis-open dot org
- Date: Fri, 19 Jul 2002 16:54:10 +0200
- Subject: RE: DOCBOOK-APPS: Page number in ToC
Oh, yeah, i've got it! Get your ruler again.
I played with some fo attributes.
I changed
<fo:leader leader-pattern="dots"
keep-with-next.within-line="always"/>
to
<fo:leader leader-pattern="dots"
leader-pattern-width="5pt"
keep-with-next.within-line="always"/>
and got the numbers perfectly aligned on the right.
But still the problem with fop.extensions, right?
No, I figured this out, too.
Here is the complete template out of fo/autotoc.xsl
<xsl:template name="toc.line">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:variable name="label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$fop.extensions != 0">
<fo:block text-align="start">
<fo:basic-link internal-destination="{$id}">
<fo:inline keep-with-next.within-line="always">
<xsl:apply-templates select="." mode="object.title.markup"/>
</fo:inline>
<fo:inline keep-together.within-line="always"
font-style="italic">
<!-- Here my suggestion -->
<xsl:text> </xsl:text>
<fo:leader leader-pattern="dots"
leader-pattern-width="5pt"
keep-with-next.within-line="always"/>
<xsl:text> </xsl:text>
<!-- end -->
<fo:page-number-citation ref-id="{$id}"/>
<xsl:text></xsl:text>
</fo:inline>
</fo:basic-link>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block text-align-last="justify"
end-indent="{$toc.indent.width}pt"
last-line-end-indent="-{$toc.indent.width}pt">
<fo:inline keep-with-next.within-line="always">
<fo:basic-link internal-destination="{$id}">
<xsl:if test="$label != ''">
<xsl:copy-of select="$label"/>
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
<xsl:apply-templates select="." mode="title.markup"/>
</fo:basic-link>
</fo:inline>
<fo:inline keep-together.within-line="always">
<xsl:text> </xsl:text>
<fo:leader leader-pattern="dots"
<!-- Here only this new attribute -->
leader-pattern-width="5pt"
keep-with-next.within-line="always"/>
<xsl:text> </xsl:text>
<fo:basic-link internal-destination="{$id}">
<fo:page-number-citation ref-id="{$id}"/>
</fo:basic-link>
</fo:inline>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Now ready for weekend,
Nico
> -----Original Message-----
> From: Jeff Beal [mailto:jeff.beal@ansys.com]
> Sent: Friday, July 19, 2002 3:28 PM
> To: 'Nicolas Nieswandt'
> Subject: RE: DOCBOOK-APPS: Page number in ToC
>
>
> I'm using FOP 0.20.3, and with your FO file I get "rough"
> right-alignment.
> That is, the numbers are aligned to the right, but you can't
> exactly lay a
> ruler down the right-hand edge and get the publishing-quality
> right-alignment that people want. Thanks for the file, though.
>
> Jeff Beal
> Ansys, Inc.
> (724)514-3150
> jeff.beal@ansys.com
>
> -----Original Message-----
> From: Nicolas Nieswandt [mailto:Nicolas.N@gmx.de]
> Sent: Thursday, July 18, 2002 4:01 PM
> To: Jeff Beal
> Subject: RE: DOCBOOK-APPS: Page number in ToC
>
> Ok, I checked the pdf output and it's still the same result.
> Good luck in examine the FO file.
>
> Nico