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

From: DESEYNE Jacques <Jacques.DESEYNE@swift.com>
Date: Tue Apr 05 2005 - 01:48:37 PDT

Martin,

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-----
>From: owner-xep-support@renderx.com 
>[mailto:owner-xep-support@renderx.com] On Behalf Of Martin Holmes
>Sent: Monday, April 04, 2005 10:26 PM
>To: xep-support@renderx.com
>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 
>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?
>
>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!
>Martin
>
>______________________________________
>Martin Holmes
>University of Victoria Humanities Computing and Media Centre
>mholmes@uvic.ca
>martin@mholmes.com
>mholmes@halfbakedsoftware.com
>http://www.mholmes.com
>http://web.uvic.ca/hcmc/
>http://www.halfbakedsoftware.com
>
>-------------------
>(*) 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/tos.html
>

-------------------
(*) 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/tos.html

Received on Tue Apr 5 02:28:04 2005

This archive was generated by hypermail 2.1.8 : Tue Apr 05 2005 - 02:28:06 PDT