[xep-support] Table of Contents: Leaders are not wrapping...

Kevin Brown kevin at renderx.com
Sat Jan 16 09:20:36 PST 2010


Paul:

How about this:

<fo:block text-align="left" text-align-last="justify">
	This is a long line of text in the TOC with even more text and more
text and
	<fo:inline keep-together.within-line="always">
		<fo:leader leader-pattern="dots"/>
		123
	</fo:inline>
</fo:block>

I tested and it seems to keep the dots together with the number which is
what you are looking for I believe.

Kevin Brown
RenderX


-----Original Message-----
From: owner-xep-support at renderx.com [mailto:owner-xep-support at renderx.com]
On Behalf Of Harvey, Paul
Sent: Saturday, January 16, 2010 8:11 AM
To: xep-support at renderx.com
Subject: [xep-support] Table of Contents: Leaders are not wrapping...

This is issue described below (from
http://www.dpawson.co.uk/xsl/sect3/foindexing.html#d12457e160) describes
my situation...

--------------------------------------------------------------------
>I have code which formats a table of contents with the
>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 justified (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 solution?
--------------------------------------------------------------------

I have tried both of the following solutions but none get me to my goal
of always having the page number right-justified with leader dots.

--------------------------------------------------------------------
>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>
--------------------------------------------------------------------

The best I've got so far when the title is "is a little too long, but
not long enough to wrap itself"...is something like this:

This is my title which is a little too long but not long enough
   134

When what I want I really want is this:
This is my title which is a little too long but not long enough
   ..............................................................134

Any thoughts on how to get there?

Thanks!


-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
http://www.renderx.com/terms-of-service.html

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html



More information about the Xep-support mailing list