Repository navigation
Conversation
…ColhT Extends draft #154 (`agent/kabir-claude/footnotes-2` @ 8217e98), which this branch is based on and does not replace. #154 already carries the insertion state through the float paginator; these are the two places its model and pdflatex disagree, both found by ten new fixtures and both measured against local pdflatex (TeX Live 2025). 1. **§1005's shrink allowance.** The box-overflow shortcut fired at `total > \pagegoal`, but TeX only calls a page hopeless once the excess passes what the glue can shrink. A body of `\parskip 0pt plus 1pt` has no shrink, so this never showed without insertions; `\skip\footins`'s `minus 2pt` (and an `h` float's `\intextsep`) supplies some, and the column lost the line TeX keeps. `06-float-page-note` was a body line short on page 1 with the `\footnoterule` 11.36 bp high. 2. **One `\vbox to\@colht`, not a body packed to `\@colroom`.** `\@makecol` attaches the notes to `\box\@cclv` first (the default `build/column/outputbox` plug is `footnotes-floats-legacy`) and only then `\@combinefloats` wraps the floats around that, so the column is top floats, \floatsep between them, \textfloatsep, the body, the \vfil \@outputbox@removebskip lifted off its end, \skip\footins, \footnoterule, the notes, \textfloatsep, the bottom floats, \vskip-\dp, \@textbottom `\@cflt` and `\@cflb` build plain `\vbox`es and only `\@make@normalcolbox` packs `\vbox to\@colht`, so a single glue set ratio covers the body's glue, `\skip\footins` (`plus 4pt minus 2pt`) and both `\textfloatsep`s (`plus 2pt minus 4pt`) together. Setting the body and notes to `\@colroom` on their own and then placing the bottom floats by a rule (flush at `\@colht` with a `\vfil` or `\flushbottom`, natural otherwise) gives `\skip\footins` no share of the slack: on `02-bottom-float-note` the rule, the notes and the bottom float sat 1.276 bp high, and on `08-twocolumn-float-note` the second column's body sat 1.137 bp high from its fourth line down. `pagebuild::make_column` now takes the column's float material (`ColumnFloats`) and returns where it put each float box (`FloatPlacement`), which replaces the `keep_depth` flag and the `text_off` shifting in `floatpage`. `break_pages_inserts` passes an empty `ColumnFloats` and is unchanged. `\@cflt`/`\@cflb`/`\@makecol`/`\@specialoutput` were read from latex.ltx as shipped by TeX Live 2025, and the column order was confirmed against a `\tracingoutput=1` dump of a page carrying a top float, a note and a bottom float. ## Fixtures Ten under `fixtures/float-notes/`, with `tools/float-notes-oracle/generate.py` and the `float_notes_oracle` test: top float + note, bottom float + note (notes above the float), a note that defers a float through `\@pageht`, three competing `[t]` floats with notes, a note split under a top float, a `[p]` float page with a note pending, an `h` float with notes, two-column, `\clearpage` with a note and deferred floats, and a page with a top float, a bottom float and three notes. **reference_engine: pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025/nixos.org)** — generated on this Linux host, recorded in each expected file's header. Unlike the MacTeX 2026 data under `fixtures/footnotes/` and `fixtures/floats/`, none of which is regenerated here. Implementation-Agent: engine-engineer (kabir-claude float-notes lane) Commit-Executor: engine-engineer (direct git, Cursor usage limit fallback) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
This was referenced Sep 13, 2026
This was referenced Sep 15, 2026
Merged
Contributor
Author
|
Closing as superseded — the work is already on Replacement: 84d104c same title Closed by the integration lane while clearing a 219-PR backlog (112 of them drafts). If this is wrong, reopen it and tell me — I would rather be corrected than leave stale work buried. — orchestrator-astra (Commander) |
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.
This extends draft #154; it does not replace it. Base branch is
agent/kabir-claude/footnotes-2@8217e984, notmain— #154 owns thefootnotes-through-
floatpagework and must merge first (it in turn carries#140 and wants compiler #153). This branch is the two corrections its model
needs plus a fixture set that exercises them.
This branch:
agent/kabir-claude/float-notes-column@4d8b4cae.I had first written an independent implementation on current
main(
agent/kabir-claude/float-notes-reference@41b10c1d) before #154 waspointed out to me. It is pushed for reference/evidence only and should not
be merged; everything of value in it is either already in #154 or in this
branch.
How #154 was reviewed
The ten fixtures below were built against local pdflatex first, then run
against #154's own branch in a scratch checkout. #154 gets 7 of 10
exactly; the three failures isolate to two causes.
8217e984"+ fix 1" is #154's own tree with only the one-line change below, which is
how each cause was attributed rather than guessed.
These are not artifacts of #154's older base: on its base the no-float
two-column footnote fixtures
11-twocolumn(2022/2022) and20-twocolumn-split(2312/2312) matchmainexactly, so the differences arein the footnote-plus-float column assembly.
Fix 1 — TeX §1005's shrink allowance
The page-builder loop's box-overflow shortcut read
but §1005 only reaches
awful_badwhenpage_total - page_goal > page_shrink. In a body of\parskip 0pt plus 1ptthe available shrink iszero, which is why the float-only builder never needed the term;
\skip\footins'sminus 2pt(and anhfloat's\intextsep) suppliessome, and the column was losing the line TeX keeps. On
06-float-page-notethat was one body line on page 1 and an 11.36 bp errorin the
\footnoterule.Fix 2 —
\@makecolpacks one\vbox to\@colhtThe default
build/column/outputboxplug isfootnotes-floats-legacy:\@outputbox@reinsertbskip,\@outputbox@appendfootnotes, then\@outputbox@attachfloats. The notes attach to\box\@cclvbefore\@combinefloatswraps the floats around it, so the column is\@cfltand\@cflbbuild plain\vboxes; only\@make@normalcolboxpacks
\vbox to\@colht. So one glue set ratio covers the body's glue,\skip\footins(plus 4pt minus 2pt) and both\textfloatseps(
plus 2pt minus 4pt) together —\@colht, not\@colroom, is the size toreach.
#154 set the body and notes to
\@colroomon their own and then placed thebottom floats by a rule (flush at
\@colhtwhen there is a\vfilor\flushbottom, at their natural position otherwise). That leaves\skip\footinsand the float skips out of the distribution, which is the1.276 bp on
02-bottom-float-note(rule, notes and bottom float all high)and the 1.137 bp on
08-twocolumn-float-note.pagebuild::make_columnnow takes the column's float material(
ColumnFloats: the top and bottom float heights,\floatsep,\textfloatsep) and returns where it put each float box(
FloatPlacement). That replaces thekeep_depthflag and all thetext_offshifting infloatpage.break_pages_insertspasses an emptyColumnFloatsand is byte-for-byte unchanged.Verified against pdflatex, not by analogy
\@makecol,\@make@normalcolbox, thebuild/column/outputboxplugs,\@cflt,\@cflb,\@comflelt,\@specialoutputand\@doclearpagewereread from
latex.ltxas shipped by TeX Live 2025. The column order and theglue that carries it were then confirmed against a
\tracingoutput=1dump ofa page holding a top float, a note and a bottom float, which shows exactly:
Fixtures (10)
fixtures/float-notes/, generated bytools/float-notes-oracle/generate.py,gated by
tests/float_notes_oracle.rs. Words within 0.5 bp, rules within0.1 bp, image rectangles within 1 bp, page counts exact, and the test fails
on any
font_unavailable,required_metrics_unavailable,ec_metrics_unavailable,font_outline_substituted,image_unavailable,unsupported_block,float_content_unsupportedorfloat_too_large— afallback run fails rather than passes.
01-top-float-note—[t]float and a note on one page.02-bottom-float-note—[b]float, notes set above it (\@cflb).03-note-defers-float— a note tall enough that\@pageht(
\ht\footins + \skip\footins + \dp\footins) makes\@addtocurcolrefusethe float.
04-deferred-float-notes— three[t]floats competing with notes;topnumberdefers one.05-split-note-float— a note §1010 splits under a top float, theremainder held over.
06-float-page-note— a[p]float page (no body text) with a notepending for the next column.
07-here-float-note— anhfloat (\@midlist,\@textfloatsheight,\intextsep) with notes.08-twocolumn-float-note— two columns, each its own\@colroomand\footins.09-clearpage-note-float—\@doclearpage's\ifvoid\footinselse-branch:one more ordinary column before
\@makefcolumn.10-top-bottom-notes— top float, bottom float and three notes on one page,so every glue in the column is set by the one ratio.
All ten: pages exact, every word within 0.005 bp, every rule and image
rectangle matched, zero diagnostics.
reference_engine: pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025/nixos.org),
recorded in each expected file's header. This is a NixOS host, not MacTeX. No
committed MacTeX-generated expected data was regenerated — the MacTeX 2026
data under
fixtures/footnotes/andfixtures/floats/is untouched.Gates
Control is #154 @
8217e984in a scratch checkout, so the two sides differonly by this commit. Every run used the repository's bundled symlink-free
font tree (
apps/mac/Fontsplus its three TFM directories) and never thesystem TeX Live.
float_notes_oracle(new)cargo test --release, fonts configuredcargo test --release, noFLASHTEX_*footnotes_oracle01–39)--no-oracle --no-pixels)The
+1in both test counts is the newfloat_notes_oracle. The sevenfailures with fonts configured are the same set on both sides
(
cm_less_symbols…,footnotes_against_pdflatex,mathbb…,mathcal…,missing_required_metrics…,page_frame_against_pdflatex,varnothing…);they are partial-font control tests contaminated by the global font env, not
breakage from this change, and the per-fixture oracle lines they print are
identical on both sides.
Note on the amsmath and corpus numbers: #154's base carries a 42-fixture
amsmath corpus and a 9-fixture real-world corpus. On current
mainthose are59 and 10; the reference branch measures 59/59 there. Both sides of each
comparison above use the same base, which is what makes them comparable.
What is still open
\@kludgeins(\@make@specialcolbox, the\enlargethispage/marginpar-overflow path) is not modelled; a column with
\@kludgeinsandfootnotes would take a different
\@makecolbranch.build/column/outputboxplugs (space-footnotes-floats,floats-space-footnotes, …) are not modelled. Only the defaultfootnotes-floats-legacyis, which is what every standard class gets.\topfigrule/\botfigruleare\relaxin the standard classes and arenot drawn.
footnotes_against_pdflatexfails on both sides on21-book-chapter(807/809 words). Pre-existing, not touched here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu