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

Peter Seibel peter at javamonkey.com
Fri Oct 1 19:18:16 UTC 2004


"Marc Battyani" <marc.battyani at fractalconcept.com> writes:

> Peter Seibel <peter at javamonkey.com> writes:
>>
>> I haven't tried your new version yet because I had an idea last night
>> about what the problem might be. The thing that lead me down the path
>> to my workaround of yesterday was noticing that while my reference got
>> correctly located (page-number, x, and y set) in stroke, that on the
>> second pass it would get replaced by a new, unlocated reference when
>> mark-ref-point was called. My workaround was a kludge but I think the
>> idea was right--if mark-ref-point is called because a subsequent pass
>> is being processed (so the ref is not in *reference-table* but is in
>> *previous-reference-table*) then instead of making a new ref-point we
>> should copy the previous ref-point. Then the test in stroke to
>> determine whether the ref-point has been changed is more
>> straightforward--if the current values are different than the ones
>> actually stored in the reference it is changing. Below is a patch.
>> I'll revert this and try your new code but you can feel free to fold
>> it in if appropriate.
>
> The located-p stuff I added is still needed because of the
> header/footer and other out of order things. But your idea of
> copying the previous ref makes me think that reusing the reference
> is a good idea. In fact looking at your code make me think that this
> previous-ref stuff in not needed at all now that there is located-p
> I will look at this now.

Cool. BTW, my code also genenerated headers out of order. At least I
think so--I compile-text the main body of my document which includes
the mark-ref-point call and then I loop using compile-text to build a
header and drawing the individual pages. And that worked with just my
patch. (You can see my code in earlier messages.)

> Checking if the x and y coordonates have changed is probably too
> strict and will give many redefined refs IMO.

Yes. I did have to bump up *max-number-of-passes* to get it to
actually settle down. (Took three passes instead of two.)

-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