Is there a good reference for LaTeX's output routine? The documented source is confused and confusing. The authors seem confused as to why parts are the way they are and wonder if maybe things should be changed:
Not sure about these: two questions. Should things which must apply to a whole
doument be local or global (they probably should be ‘preamble only’ commands)?
Are these three such things?
My favorite quotes so far are the following gems.
This is a very much an emergency action, just dumping everything: footnotes first
then floats. A more sophisticated version is needed; but even more urgent is a
bug-free version (see, for example, pr/3528).
We empty any left over kludge insert box here; this is a temporary fix. It should
perhaps be applied to one page of cleared floats, but who cares? The whole of this
stuff needs completely redoing for many such reasons.
I suspect that tex.stackexchange is not the right place for explaining what the entire output routine is doing, but I'd appreciate any pointers to a clear explanation. I'm especially interested in why the float mechanism invokes the output routine (with large negative penalties), sometimes multiple times; how pages of floats are processed; what these kludge insert boxes are; and what hooks class authors can use.