Repository navigation
docs(engine): running heads, and the stub that outlived three correct fixes - #25
Merged
Merged
Conversation
… fixes The marks work is the clearest case the page-count barometer cannot report, so it belongs beside the hashdiff table that already explains why: 6 of 154 renders differ at IDENTICAL page counts, and 27 of the 128 corpus papers with a reference PDF now get the head they had been missing, for zero movement in the three numbers -- a head replaces blank space in a header that was already reserved. The mechanism is written down with the sources it was ported from rather than asserted, because every part of it is a decision someone can check: fire_up derives the three quantities a head is written from (tex.web:19718-19729, :19782-19789) -- topmark is the previous page's botmark, firstmark is this page's first mark or else topmark, and botmark is this page's last mark and is NOT cleared on a page carrying none, which is what makes a head persist across a chapter. Above that, latex.ltx keeps the left/right pair in one token list, \@theMark (ltpage.dtx:355), read back through \@firstoftwo/\@secondoftwo (:167-174, :341-342), and \@markright keeps the left half on purpose -- which is why \markright in a \section does not erase the chapter. And the lesson, in a callout because it generalises past this engine: the change took four fixes, three of them correct and insufficient, because a one-line substrate stub -- \def\mark#1{} -- accepted its argument and discarded it one layer BELOW all three. Each correct fix above it changed nothing observable and so looked wrong. What found it was a different question rather than a better fix: a test asking whether the node ARRIVES, not whether the layer emitting it is right. Any stub that accepts input and drops it will outlive every repair made above it. Built locally with the pinned theme submodule and checked in the OUTPUT, not just for a zero exit: the prose, the table row and the callout's inner text are all present in public/packages/engine/index.html, and no literal shortcode survived into the HTML. Refs go-tex/engine#426, go-tex/engine#729 Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The third surface for the marks work. The README (engine#734) and the landing page (go-tex.github.io#221, merged and verified live) carry it; this is the one that can afford the mechanism.
Why it goes beside the
hashdifftableThat table exists to say what the three fidelity numbers cannot see, and running heads are its clearest case:
Zero movement is the honest figure, not a disappointing one: a head replaces blank space in a running header the page had already reserved. Only a per-page hash sees the change at all.
The mechanism is cited, not asserted
Every part of it is a decision a reader can check against the source it was ported from:
fire_upderives the three quantities a head is written from (tex.web:19718-19729,:19782-19789):\topmarkis the previous page's\botmark,\firstmarkis this page's first mark or else\topmark, and\botmarkis this page's last mark and is not cleared on a page that carries none — which is precisely what makes a head persist across a chapter.latex.ltxkeeps the left/right pair in one token list,\@themark(ltpage.dtx:355), read back through\@firstoftwo/\@secondoftwo(:167-174,:341-342), and\@markrightkeeps the left half deliberately — which is why\markrightinside a\sectiondoes not erase the chapter.And the lesson, in a callout
It generalises well past this engine, so it is set off rather than buried: the change took four fixes, three of them correct and insufficient. A one-line substrate stub,
\def\mark#1{}, accepted its argument and discarded it one layer below all three, so each correct fix above it changed nothing observable and therefore looked wrong. What found it was not a better fix but a different question — a test asking whether the node arrives, rather than whether the layer emitting it is right. Any stub that accepts input and drops it will outlive every repair made above it.Checks
Built locally with the pinned theme submodule, and checked in the output rather than on a zero exit status — a build that succeeds while a shortcode survives as literal text is a passing build and a broken page:
hugo --minifyclean, 14 pages;public/packages/engine/index.html;{{<in the rendered HTML.I will check the published page after the Pages build rather than assuming the deploy implies it.
Refs go-tex/engine#426, go-tex/engine#729
🤖 Generated with Claude Code