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

Peter Seibel peter at javamonkey.com
Thu Sep 30 21:56:16 UTC 2004


Peter Seibel <peter at javamonkey.com> writes:

> "Marc Battyani" <marc.battyani at fractalconcept.com> writes:
>
>> Bob Hutchison wrote:
>>> On Sep 30, 2004, at 4:39 PM, Marc Battyani wrote:
>>>
>>> > The multipass mechnism is integrated into typeset:with-document so it
>>> > should
>>> > work in your code.
>>> >
>>> > As they are several passes you should use:
>>> >
>>> >  (when (typeset::final-pass-p)
>>> >    (pdf:write-document file))
>>>
>>> This doesn't seem to make any difference. I'm not sure what happens if
>>> it isn't the final pass? how does the document get written?
>>>
>>> >
>>> > To avoid writing the pdf file during the intermediate passes.
>>> > (I will probably redefine write-document in typeset to handle this more
>>> > easily.)
>>> >
>>> > How many passes go you get ?
>>> > What are the values of *current-pass* *undefined-references*
>>> > *changed-references* ?
>>>
>>> I am getting current pass: 1, undefined references: NIL,
>>> changed-references: NIL
>>
>> This is not good. When the ref id is not yet defined,
>> #'find-ref-point-page-number should push the missing ref id in
>> *undefined-references*. This would start a second pass.
>
> So, it looks like in my case that it's finding the ref-point. It's
> just that the page-number slot of the ref point is set to 999 and is
> never getting reset. What's supposed to trigger that?

Okay, more diggging around and I got it to work. The problem was my
call to mark-ref-point was clobbering the old ref. So I changed my
call:

  (typeset:mark-ref-point :the-end)

to:

  (unless (typeset::find-ref-point :the-end)
    (typeset:mark-ref-point :the-end))

It seems, at the very least, that perhaps this check in mark-ref-point

  (when (gethash id *reference-table*)
    (error "Reference ~s redefined" id))

should be written:

  (when (find-ref-point id)
    (error "Reference ~s redefined" id))

so it'll look in *previous-reference-table* as well as
*reference-table*. That at least would have given me an error.

-Peter

-- 
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