Le dimanche 29 novembre 2009 à 15:07, J.Pietschmann a écrit:
> Anyway, why don't you use a separate page sequence for every
> chapter?
I'm a newbie, and I didn't even know it was possible to call a
<fo:page-sequence> from deeper in the <xsl:template> hierarchy than on the
first level of <fo:root>. After your answer, I've found an example from
Jordan Naftolin on the web, and, with a few adaptations, it works. So the
problem is solved for me.
Le dimanche 29 novembre 2009 à 22:18, J.Pietschmann a écrit:
> No, I meant using markers. There are several ways to get
> what you probably want. The following might work (beware,
> untested!):
> <fo:static-content ...>
> <fo:retrieve-marker retrieve-class-name="chapter-title"
> retrieve-position="first-starting-within-page"
> retrieve-boundary="document"/>
> ...
> <fo:block>
> <!-- first an empty marker -->
> <fo:marker marker-class-name="chapter-title"/>
> <!-- now with the title text for subsequent page headers -->
> <fo:marker marker-class-name="chapter-title">The Chapter
> Title</fo:marker>
> <!-- now the title text for the flow -->
> The Chapter Title
> </fo:block>
I've tried this too. It works, with a few adaptations:
- I doesn't to work (by me) with an empty element:
<fo:marker marker-class-name="chapter-title"/>,
but it works with an empty content:
<fo:marker marker-class-name="chapitre">
<xsl:text> </xsl:text>
</fo:marker>
- I had to put the <fo:marker>'s on a lower level than 'chapter'. The first
paragraph gives an marker with an empty content, all others the marker I want
on the top of the page:
<xsl:template match="para">
<fo:block>
<xsl:if test="count(preceding-sibling::para) = 0">
<fo:marker marker-class-name="chapitre">
<xsl:text> </xsl:text>
</fo:marker>
</xsl:if>
<xsl:if test="count(preceding-sibling::para) > 0">
<fo:marker marker-class-name="chapitre">
<xsl:text>Chapitre </xsl:text>
<xsl:number select=".." format="1"/>
</fo:marker>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
In the <fo:page-sequence>, the page head is so defined:
<fo:static-content flow-name="titre_courant">
<fo:block/>
<fo:block text-align="center" space-before="1.5cm">
<fo:retrieve-marker retrieve-class-name="chapitre"
retrieve-position="first-starting-within-page"
retrieve-boundary="page"/>
</fo:block>
</fo:static-content>
There are perhaps some other ways to obtain the same result.
Anyway, very gratefully thanks. I've learned a lot yesterday and this morning.
Philippe
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]