[cl-typesetting-devel] multi-page documents

Peter Seibel peter at javamonkey.com
Tue Jan 20 00:24:39 UTC 2004


Peter Seibel <peter at javamonkey.com> writes:

> Here's what I hacked up. Seems to fix my problem but I don't know if
> it's The Right Thing.

Hmmm. I could of sworn this was working. But now it's not. (Or there's
something else wrong that manifests in the same way.)

-Peter

> 
> Index: layout.lisp
> ===================================================================
> --- layout.lisp	(revision 3)
> +++ layout.lisp	(working copy)
> @@ -195,8 +195,16 @@
>    (with-text-content (content)
>      (multiple-value-bind (lines boxes-left) (split-lines (boxes content) dx dy v-align)
>        (when lines
> -	(let* ((box (make-instance 'vbox :dx dx :dy dy :boxes lines :fixed-size t)))
> +	(let* ((box (make-instance 'vbox :dx dx :dy dy :boxes lines :fixed-size t))
> +	       (last-style (find-last-style (boxes content) boxes-left)))
>  	  (do-layout box)
> -	  (setf (boxes content) boxes-left)
> +	  (setf (boxes content) (and boxes-left (cons last-style boxes-left)))
>  	  box)))))
>  
> +(defun find-last-style (orig-boxes boxes-left)
> +  "Find the last style element in orig-boxes prior to boxes-left"
> +  (loop with last-style = nil
> +	for cons on orig-boxes
> +	for element = (car cons)
> +	when (style-p element) do (setf last-style element)
> +	when (eql cons boxes-left) return last-style))
> 
> 
> -Peter
> 
> -- 
> Peter Seibel                                      peter at javamonkey.com
> 
>          Lisp is the red pill. -- John Fraser, comp.lang.lisp
> 
> _______________________________________________
> cl-typesetting-devel site list
> cl-typesetting-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/cl-typesetting-devel
> 

-- 
Peter Seibel                                      peter at javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp




More information about the cl-typesetting-devel mailing list