Re: [xep-support] TOC leader and page ref wrapping badly

From: Martin Holmes <>
Date: Tue Apr 05 2005 - 05:50:32 PDT

Hi there,

I think that'll do it -- many thanks!

DESEYNE Jacques wrote:

>You could set letter-spacing="0" on the page-number-citation element:
><fo:block text-align="left" text-align-last="justify">Section title<fo:leader leader-pattern="dots"/><fo:page-number-citation
>ref-id="div47132" letter-spacing="0"/></fo:block>
>Alternatively/additionally, you could insert a non-breaking space (0xa0) between leader and page-number-citation to force the leader
>to keep on the same line as the page number. The leader will be stretched rather than the generated page number. Of course, you will
>observe a little space between leader and page number. Inserting a zero-width joiner (0x200d) instead of the non-breaking space
>could solve this, but then the 'text-align-last="justify"' is not always honoured (with XEP 3.8). Setting an additional end-indent
>on the block save for the last line may improve the result (at least we think so: the last "word" of a title then often wraps as
>well), e.g. in the following:
><fo:block text-align-last="justify"
> text-align="left"
> end-indent="12pt"
> last-line-end-indent="-12pt">Section title<fo:leader leader-pattern="dots"/>&#xa0;<fo:page-number-citation
>ref-id="div47132" letter-spacing="0"/></fo:block>
>Best regards,
>Jacques DESEYNE
>>-----Original Message-----
>>[] On Behalf Of Martin Holmes
>>Sent: Monday, April 04, 2005 10:26 PM
>>Subject: [xep-support] TOC leader and page ref wrapping badly
>>Hi folks,
>>I wonder if anyone can help with this:
>>I have code (below) which formats a table of contents with the chapter
>>title, followed by a dotted leader, and the page number on the
>>right. In
>>rare cases when the title of the chapter is a little too long,
>>but not long
>>enough to wrap itself, I end up with a situation where the
>>title will be
>>followed by one or two dots of the leader, then the page
>>number will be
>>wrapped to the next line, where it is not right-justified, but
>>(which leads to digits in the page number being spread across
>>the whole
>>line). Has anyone hit this problem before, and if so, can you
>>suggest a
>>Here's the code:
>> <xsl:for-each select="//TEI.2">
>> <xsl:sort
>>select="descendant::teiHeader/fileDesc/titleStmt/author/name/@reg" />
>> <fo:block text-align-last="justify">
>> <xsl:value-of
>>select="text/front/docTitle/titlePart" />
>> <fo:leader leader-pattern="dots"/>
>> <fo:page-number-citation>
>> <xsl:attribute name="ref-id">
>> <xsl:value-of select="@id" />
>> </xsl:attribute>
>> </fo:page-number-citation>
>> </fo:block>
>><!-- Get the list of authors for the paper -->
>> <fo:block xsl:use-attribute-sets="TOCAuthors">
>> <xsl:for-each select=".//docAuthor/name">
>> <xsl:if test="position() &gt; 1">, </xsl:if>
>> <xsl:value-of select="." />
>> </xsl:for-each>
>> </fo:block>
>> </xsl:for-each>
>>All help appreciated!

(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
Received on Tue Apr 5 06:31:46 2005

This archive was generated by hypermail 2.1.8 : Tue Apr 05 2005 - 06:31:49 PDT