Hi Georg,

Georg Datterl wrote:
> Hi Jeremias,
> 
> I finally came around to testing your keep-together with numbers and it did 
> not quite work as I did not expect anyway.
> 
> Let's assume I have one block with five child blocks. If all five blocks fit 
> on one page, keep them on one page. Otherwise break between block 3 and 4. If 
> any block alone is too big for one page, break it where necessary.
> 
> <block keep-together.within-page="1" >
>       <block keep-together.within-page="3" >(block 1 content)</block>
>       <block keep-together.within-page="3" >(block 2 content)</block>
>       <block keep-together.within-page="2" >(block 3 content)</block>
>       <block keep-together.within-page="3" >(block 4 content)</block>
>       <block keep-together.within-page="3" >(block 5 content)</block>
> </block>
> 
> should that work? do I need more wrapping blocks like maybe one block around 
> blocks 1-3 and one around 4 and 5? 

I think so. Something like this:
    <block keep-together.within-page="1">
      <block keep-together.within-page="2">
        <block keep-together.within-page="3">(block 1 content)</block>
        <block keep-together.within-page="3">(block 2 content)</block>
        <block keep-together.within-page="3">(block 3 content)</block>
      </block>
      <block keep-together.within-page="2">
        <block keep-together.within-page="3">(block 4 content)</block>
        <block keep-together.within-page="3">(block 5 content)</block>
      </block>
    </block>

However this is all theoretical, since FOP currently handles all integer
values the same way; that is, set a very high penalty for breaking
inside the block, but not forbid it completely. The idea is to encourage
the algorithm to favour layouts without breaks over those with breaks.
While this might not always be the case, the hope is that this is what
will happen for most real-life documents.

To achieve what you need integer keeps would have to be fully
implemented. I don’t think there is any solution other than that,
unfortunately.


> Regards,
>  
> Georg Datterl

HTH,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

Reply via email to