[cl-typesetting-devel] More on laying out sub-boxes

Marc Battyani marc.battyani at fractalconcept.com
Fri Jan 26 12:01:08 UTC 2007


"Ken McKee" <rkm101 at mac.com> wrote:
>
> I read the thread from Jun 2005 regarding laying out boxes.
> http://common-lisp.net/pipermail/cl-typesetting-devel/2005-June/ 
> thread.html
> Peter Seibel inquired about the natural size of content blocks. A  better 
> solution was found for his task, but I would like to pursue  his original 
> intent.
>
> Our documents are comprised of sections, subsections and items.
> We need, at least, to avoid splitting the items across pages.
>
> Is there a way to ask cl-typesetting to keep a content block on the  same 
> page, even if means pushing the entire block to the next page?
> This would satisfy our immediate needs.
>
> If not, we can paginate the document ourselves. To do this (without 
> falling back on cl-pdf) we will need to find the size of a block of 
> content (a text-content?). In the end we might want to do this  anyway. We 
> have some options to layout an item. For example, they can  be vertically 
> or horizontally inclined. I can imagine that we would  use 
> cl-typesetting's features to layout the text within each content  block, 
> but our layout engine could adjust the options for the items  to avoid 
> splitting items and subsections.

Right now there is no "keep this as one block" option but you can insert 
:eop to force a new page. So you just need to compute the sizes of your 
blocks and then insert :eop where needed.

To compute the height of a block something like this should work:
(compute-boxes-natural-size (boxes (make-filled-vbox block-content width 
10000000 :top)) #'dy)

Marc





More information about the cl-typesetting-devel mailing list