Every \ref/\pageref in the document, in source order.
Steps consumed, for CompileStats.steps.
The half of the two-pass cycle that only layout can close.
\pageref cannot know its page until the document has been broken into
pages, and the page it lands on can depend on how wide the reference
prints — the same circularity LaTeX resolves with an .aux file and a
second run. Chunk 7 does the same: lay out once with every \pageref
still showing ??, collect marker name → page number from the Marker
nodes it placed, call this, and lay out again. ReferenceInline.text is
mutable precisely so the second run re-reads it without the model being
rebuilt.
Returns a diagnostic for every \pageref whose marker never appeared,
so a reference that would print ?? is never silent.
Every
\cite/\citep/\citet/\nocite, in source order — besidereferencesrather than on the document for the same reason: they are the inputs to a resolution pass, not part of what the document means.\nocitesites are here too, and print nothing.