> >>  since a diversion isn't paginated until it is flushed out,
> >>  how would we capture TOC entries, with proper page number
> >>  references, while collecting the main body diversion?
> >
> > Simple: you create a temporary page diversion for collecting
> > text.  When that is full, you increment your own page counter,
> > divert-append the page diversion to the body diversion, clear
> > the page diversion, and continue collecting more text in the
> > page diversion...
> 
> Ok.  I think I get the idea.  Presumably you would use a diversion
> trap at the physical page length, less the header an footer margins,
> to detect when the page diversion is full?  But would that not get
> horribly complicated, when considering the effect of footnote
> diversions and other types of keep.
>
> I guess, if implementing something like this, we wouldn't be using
> it in conjunction with the `ms' or `mm' macros.

Yes. One of the complications that comes to mind is that
in contrast to direct output to the "page" (the "top-level
diversion"), which supports an arbitrary number of "position
traps", any other diversion only supports a single "diversion
trap".  So if your macro package makes extensive use of
position traps, I'd say you're in for some seriuos rewriting...



_______________________________________________
Groff mailing list
Groff@gnu.org
http://lists.gnu.org/mailman/listinfo/groff

Reply via email to