This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to avoid pagebreak between <section> title andbody?


>>>>> Steinar Bang <sb@dod.no>:

>>>>> 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.

[snip!]

> I tried that now, by putting the following into my local XSL style
> sheet: 
>   <xsl:template name="section.heading">
[snip!]
>     <fo:block font-size="{$fsize}pt"
>               break-before="page"
[snip!]
>       <xsl:copy-of select="$title"/>
>     </fo:block>
>   </xsl:template>

I think "keep-with-next" is closer to what I want.  I replaced 
	break-before="page"
with
	keep-with-next="always"
but that formatted the same as with the vanilla DocBook XSL template.

And when I looked at the produced FO, I saw that the <fo:block>
surrounding the <fo:block> containing the title text, it already had a
keep-with-next.within-column attribute:

  <fo:block id="d0e152">
    <fo:block>
      <fo:block keep-together="always" margin-left="-4pc"
      font-family="Helvetica">
        <fo:block keep-with-next.within-column="always">
          <fo:block font-size="14pt" keep-with-next="always"
          font-weight="bold" font-family="Helvetica"
          space-before.minimum="1em" space-before.optimum="1.5em"
          space-before.maximum="2em">Configure mouse</fo:block>
        </fo:block>
      </fo:block>
    </fo:block>
  </fo:block>

So why does the title separate from the body of the section?  Because
of confusion about what's the "next" to stay with?





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]