You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by kralik <kr...@ijablonec.cz> on 2006/04/11 17:28:31 UTC
TOC problem with text-align-last
I have problem in FOP Trunk.
I am trying to make Table Of Contents to look like this (but not with using
"pre"):
TOC
1 chapter1name . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 subchapter1name . . . . . . . . . . . . . . . . . . .
. 1
1.2 subchapter2name . . . . . . . . . . . . . . . . . . . . 2
1.3 subchapter3name . . . . . . . . . . . . . . . . . . . . 3
2 chapter2name . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 subchapter1name . . . . . . . . . . . . . . . . . . . . 5
2.1.1 subsubchapter1name . . . . . . . . . . . . . . . . 7
2.1.2 subsubchapter2name . . . . . . . . . . . . . . . . 9
2.2 subchapter2name . . . . . . . . . . . . . . . . . . . . 11
2.3 subchapter3name . . . . . . . . . . . . . . . . . . . . 12
Beginnings of each line are OK (I am using text-indent), but on the right
side I am getting a bit strange alignment (text-align-last="justify" seems
works incorectly):
TOC
1 chapter1name . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 subchapter1name . . . . . . . . . . . . . . . . . . . . 1
1.2 subchapter2name . . . . . . . . . . . . . . . . . . . . 2
1.3 subchapter3name . . . . . . . . . . . . . . . . . . . . 3
2 chapter2name . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 subchapter1name . . . . . . . . . . . . . . . . . . . . 5
2.1.1 subsubchapter1name . . . . . . . . . . . . . . . . 7
2.1.2 subsubchapter2name . . . . . . . . . . . . . . . . 9
2.2 subchapter2name . . . . . . . . . . . . . . . . . . . 11
2.3 subchapter3name . . . . . . . . . . . . . . . . . . . 12
Any idea, how to repeat this?
Thanks, Pavel Tyl
--
View this message in context: http://www.nabble.com/TOC-problem-with-text-align-last-t1432522.html#a3864138
Sent from the FOP - Users forum at Nabble.com.
Re: TOC problem with text-align-last
Posted by kralik <kr...@ijablonec.cz>.
This exactly I do. Sorry, I forgot to write it.
My xsl:
<xsl:template name="TOC">
<fo:block font-family="TimesNewRoman" space-after="12pt" id="Toc"
line-height="21pt" font-size="18pt" text-align="start">
Table of Contents
</fo:block>
<xsl:for-each select="/Diplomová_práce/Kapitola/Nadpis">
<fo:block font-family="TimesNewRoman" text-align-last="justify"
line-height="18pt" font-size="12pt" font-weight="bold" space-after="3pt"
space-before="18pt" start-indent="0cm">
<xsl:number count="Kapitola/Nadpis" from="Diplomová_práce" level="any"
format="1"/>  
<fo:basic-link color="blue">
<xsl:attribute name="internal-destination">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:when test="name(preceding-sibling::*[1]) = 'a' and
preceding-sibling::*[1][@name]">
<xsl:value-of select="preceding-sibling::*[1]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/> 
</fo:basic-link>
<fo:leader leader-pattern="space"/> 
<fo:page-number-citation>
<xsl:attribute name="ref-id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:when test="name(preceding-sibling::*[1]) = 'a' and
preceding-sibling::*[1][@name]">
<xsl:value-of select="preceding-sibling::*[1]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</fo:page-number-citation>
</fo:block>
<xsl:for-each select="..//Podkapitola/Nadpis">
<fo:block font-family="TimesNewRoman" text-align-last="justify"
line-height="18pt" font-size="12pt" space-after="3pt"
font-weight="normal" start-indent="0.5cm">
<xsl:number count="Kapitola/Nadpis" from="Diplomová_práce"
level="any" format="1."/>
<xsl:number count="Podkapitola/Nadpis" from="Kapitola" level="any"
format="1"/>  
<fo:basic-link color="blue">
<xsl:attribute name="internal-destination">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:when test="name(preceding-sibling::*[1]) = 'a' and
preceding-sibling::*[1][@name]">
<xsl:value-of select="preceding-sibling::*[1]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/> 
</fo:basic-link>
<fo:leader leader-pattern="dots"/> 
<fo:page-number-citation>
<xsl:attribute name="ref-id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:when test="name(preceding-sibling::*[1]) = 'a' and
preceding-sibling::*[1][@name]">
<xsl:value-of select="preceding-sibling::*[1]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</fo:page-number-citation>
</fo:block>
<xsl:for-each select="..//Článek/Nadpis">
<fo:block font-family="TimesNewRoman" text-align-last="justify"
line-height="18pt" font-size="12pt" space-after="3pt"
start-indent="1cm">
<xsl:number count="Kapitola/Nadpis" from="Diplomová_práce"
level="any" format="1."/>
<xsl:number count="Podkapitola/Nadpis" from="Kapitola" level="any"
format="1."/>
<xsl:number count="Článek/Nadpis" from="Podkapitola" level="any"
format="1"/>  
<fo:basic-link color="blue">
<xsl:attribute name="internal-destination">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:when test="name(preceding-sibling::*[1]) = 'a' and
preceding-sibling::*[1][@name]">
<xsl:value-of select="preceding-sibling::*[1]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/> 
</fo:basic-link>
<fo:leader leader-pattern="dots"/> 
<fo:page-number-citation>
<xsl:attribute name="ref-id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:when test="name(preceding-sibling::*[1]) = 'a' and
preceding-sibling::*[1][@name]">
<xsl:value-of select="preceding-sibling::*[1]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</fo:page-number-citation>
</fo:block>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
--
View this message in context: http://www.nabble.com/TOC-problem-with-text-align-last-t1432522.html#a3865062
Sent from the FOP - Users forum at Nabble.com.
Re: TOC problem with text-align-last
Posted by Johannes Künsebeck <ku...@gmx.net>.
To produce a dotted you can use the element
<fo:leader />
like this
<fo:block text-align-last="justify">
Chapter 1 <fo:leader leader-pattern = "dots"/> 1
</fo:block>
kralik wrote:
> I have problem in FOP Trunk.
> I am trying to make Table Of Contents to look like this (but not with
> using "pre"):
> TOC
> 1 chapter1name . . . . . . . . . . . . . . . . . . . . . . . . 1
> 1.1 subchapter1name . . . . . . . . . . . . . . . . . . . . 1
> 1.2 subchapter2name . . . . . . . . . . . . . . . . . . . . 2
> 1.3 subchapter3name . . . . . . . . . . . . . . . . . . . . 3
> 2 chapter2name . . . . . . . . . . . . . . . . . . . . . . . . 4
> 2.1 subchapter1name . . . . . . . . . . . . . . . . . . . . 5
> 2.1.1 subsubchapter1name . . . . . . . . . . . . . . . . 7
> 2.1.2 subsubchapter2name . . . . . . . . . . . . . . . . 9
> 2.2 subchapter2name . . . . . . . . . . . . . . . . . . . . 11
> 2.3 subchapter3name . . . . . . . . . . . . . . . . . . . . 12
>
> Beginnings of each line are OK (I am using text-indent), but on the
> right side I am getting a bit strange alignment
> (text-align-last="justify" seems works incorectly):
> TOC
> 1 chapter1name . . . . . . . . . . . . . . . . . . . . . . . . 1
> 1.1 subchapter1name . . . . . . . . . . . . . . . . . . . . 1
> 1.2 subchapter2name . . . . . . . . . . . . . . . . . . . . 2
> 1.3 subchapter3name . . . . . . . . . . . . . . . . . . . . 3
> 2 chapter2name . . . . . . . . . . . . . . . . . . . . . . . . 4
> 2.1 subchapter1name . . . . . . . . . . . . . . . . . . . . 5
> 2.1.1 subsubchapter1name . . . . . . . . . . . . . . . . 7
> 2.1.2 subsubchapter2name . . . . . . . . . . . . . . . . 9
> 2.2 subchapter2name . . . . . . . . . . . . . . . . . . . 11
> 2.3 subchapter3name . . . . . . . . . . . . . . . . . . . 12
>
> Any idea, how to repeat this?
> Thanks, Pavel Tyl
> ------------------------------------------------------------------------
> View this message in context: TOC problem with text-align-last
> <http://www.nabble.com/TOC-problem-with-text-align-last-t1432522.html#a3864138>
> Sent from the FOP - Users
> <http://www.nabble.com/FOP---Users-f353.html> forum at Nabble.com.
--
Johannes Künsebeck
Heeper Str. 52
33607 Bielefeld
0521 / 5202341
kuensebeck@gmx.net
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: TOC problem with text-align-last
Posted by kralik <kr...@ijablonec.cz>.
I described this problem in new forum. There is whole example there. It will
be probably BUG, because in XEP is everything OK. (FOP FOREVER!!! :-))
--
View this message in context: http://www.nabble.com/TOC-problem-with-text-align-last-t1432522.html#a3869550
Sent from the FOP - Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: TOC problem with text-align-last
Posted by "J.Pietschmann" <j3...@yahoo.de>.
kralik wrote:
> Beginnings of each line are OK (I am using text-indent), but on the right
> side I am getting a bit strange alignment (text-align-last="justify" seems
> works incorectly):
This may be a problem with descretisation while expanding the leader,
in combination with the NBSP after the leader being interpreted as
fixed width space. Either try the very latest trunk code (there was
a change regarding NBSP lately), or replace the NBSP by a regular space
or a ZWNBSP.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org