At 2022-07-24T11:35:45+0100, Ralph Corderoy wrote:
> > You can _do_ the table of contents in one pass; relocating it to the
> > front matter requires either a second pass or a post-processing
> > tool.  An index is a much bigger pain because it has to be sorted.
> 
> I have idly wondered from time to time if one diversion after another
> could be created, each holding a page's content without any pages
> being emitted, and then the diversions printed in a different order to
> their creation.

It seems like it should be possible, by opening diversions as the first
thing in a head-of-page trap (`PT` in ms) and closing them as the last
thing in a foot-of-page trap (`BT` in ms).  I would predict some
problems because various tools like tbl(1) behave badly because they
expect to create diversions themselves that aren't already nested.

> Memory bloat would be an obvious downside,

I predict that any such bloat would look svelte indeed compared to
Firefox or Chrome running on the same machine.

> but it's more of an experiment

...one I still wouldn't mind seeing done, if we have an enterprising
member of the mailing list...

> than a serious solution as re-arranging the pages is often
> straightforward and some post-processing already required for other
> reasons.

I think a more practical approach would be to do the page rearrangement
in the "grout" domain (the output of troff(1)), and a while back I filed
a ticket to this effect.

https://savannah.gnu.org/bugs/?61836

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to