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

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


Peter Seibel wrote:
> "Marc Battyani" <marc.battyani at fractalconcept.com> writes:
>
> > How many passes go you get ? What are the values of *current-pass*
> > *undefined-references* *changed-references* ?
>
> Okay, I added some calls to this function:
>
>   (defun show-refs ()
>     (format
>       t "*current-pass*: ~a; *undefined-references*: ~a;
*changed-references*: ~a; *max-number-of-passes*: ~a~%"
>       typeset::*current-pass* typeset::*undefined-references*
typeset::*changed-references*
>       typeset::*max-number-of-passes*))
>
> as shown here:
>
>   (defun sexp->pdf (paragraphs &optional (file #P"/tmp/hello.pdf"))
>     (let ((*note-counter* 0)
>           (*notes* nil))
>       (typeset:with-document ()
>         (let ((content
>                (typeset::compile-text ()
>                  (let ((*my-leading-ratio* 2.0))
>                    (dolist (p paragraphs) (emit-pdf p)))
>                  (typeset::vspace 24)
>                  (typeset::hrule :dy .1)
>                  (typeset::vspace 6)
>                  (let ((*default-font-size* 10))
>                    (loop for n in (nreverse *notes*)
>                          for counter from 1
>                          do (emit-note counter n)))
>                  (typeset:mark-ref-point :the-end))))
>           (loop
>              for header = (typeset::compile-text ()
>                             (typeset::paragraph
>                                 (:h-align :right :font "Times-Italic"
:font-size 10)
>                               (typeset::put-string (format nil "~a~c~d of
~d" (second (first paragraphs)) +mdash+ pdf:*page-number*
(typeset:find-ref-point-page-number :the-end))) :eol
>                               (typeset::put-string (format nil "Copyright
~c 2003-2004, Peter Seibel." +copyright+)) :eol
>                               (typeset::put-string (date-string)) :eol))
>              while (typeset::boxes content)
>              do (draw-page content header :width 612 :height 792 :margins
'(72 36 72 72) :header-height (- 108 36))
>                (show-refs)))
>         (show-refs)
>         (pdf:write-document file)))
>     (truename file))
>
> and got this:
>
>   CL-USER> (typeset-book "text/allegroserve.txt")
>   *current-pass*: 1; *undefined-references*: NIL; *changed-references*:
NIL; *max-number-of-passes*: 2


Can you add a trace of typeset:find-ref-point-page-number ?
It should push the missing ref-id in *undefined-references*

Also have you tested the full-example in test.lisp ?
(It also uses forward references)

This should work, I use refs in a 1300+ pages document, for the index and
the table of content, and I have lots and lots of references without any pb.

Marc





More information about the cl-typesetting-devel mailing list