[cl-typesetting-devel] Page n of m?

Marc Battyani marc.battyani at fractalconcept.com
Thu Sep 30 21:58:58 UTC 2004


Bob Hutchison wrote:
> It seems that I was calling the mark-ref-point too soon (i.e. before
> the footer was built). I've appended the code I am using (it is based
> on the multi-page example in test.lisp). I added some format statements
> to some methods in references.lisp and this is what I'm getting. I also
> changed the initform of pagenumber to -1 from 999 so I could see the
> difference between the reference point not being defined and the
> initform. It seems that the page number is not being changed.

No the mark-ref-point was called at the right place because it creates a box
that will be instered in the stream of boxes.
The place where you call it now is outside a text-content so the box will be
nowhere and the ref will not be computed.

>        (setq content
>              (compile-text ()
>                (paragraph (:font "Times-Bold" :font-size 16 :top-margin
> 20)
>                  "2. Second paragraph group"
>                  (hrule :dy 2))
>                (dotimes (i 40)
>                  (paragraph (:font "Times-Roman" :font-size (+ 6 (random
> 10)))
>                    (verbatim (format nil "2.~d. " (1+ i)))
>                    (dotimes (j (1+ (random 5)))
>                      (put-string "The quick brown fox jumps over the
> lazy dog. "))))
>                  ;(tt::mark-ref-point :end-of-doc) <-- This won't work
> here

No this is the right point to put it

>                ))
>        (draw-pages content :margins margins :header header :footer
> footer))
>      (tt::mark-ref-point :end-of-doc)

The ref will be nowhere here.

The problem is more with #'find-ref-point-page-number

Marc





More information about the cl-typesetting-devel mailing list