This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: How to avoid pagebreak between <section> title andbody?
>>>>> Steinar Bang <sb@dod.no>:
>>>>> Steinar Bang <sb@dod.no>:
>>>>> Steinar Bang <sb@dod.no>:
>>> Is it possible to make the <title> of a <section> in a DocBook XML
>>> article, stay with the body, when the body is pushed over to the
>>> next page during Fop formatting?
>> As an experiment, i put the attribute
>> break-before="page"
>> in the <fo:block> holding the title text for a section, and that
>> pushed the title over on the next page.
>> But how do I get this attribute into every title text?
[snip!]
> Does that mean that I have to dig out the template, paste it into my
> local XSL style sheet, and change it?
I tried that now, by putting the following into my local XSL style
sheet:
<xsl:template name="section.heading">
<xsl:param name="level">1</xsl:param>
<xsl:param name="title"></xsl:param>
<xsl:variable name="fsize">
<xsl:choose>
<xsl:when test="$level=1">18</xsl:when>
<xsl:when test="$level=2">16</xsl:when>
<xsl:when test="$level=3">14</xsl:when>
<xsl:when test="$level=4">12</xsl:when>
<xsl:when test="$level=5">12</xsl:when>
<xsl:otherwise>10</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<fo:block font-size="{$fsize}pt"
break-before="page"
font-weight="bold"
font-family="{$title.font.family}"
space-before.minimum="1em"
space-before.optimum="1.5em"
space-before.maximum="2em">
<xsl:copy-of select="$title"/>
</fo:block>
</xsl:template>
However, the result is that I get a break before every section title.
Ie. the same result as if I had put a <beginpage> before each section.
And that's not what I want. I just wish a page break before the
title's <fo:block> *if* the rest of the section is pushed on to the
next page.