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

From: Harvey, Paul <Paul_Harvey@omb.eop.gov>
Date: Sat Jan 16 2010 - 08:11:17 PST

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@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
Received on Sat Jan 16 08:39:01 2010

This archive was generated by hypermail 2.1.8 : Sat Jan 16 2010 - 08:39:06 PST