Repository navigation
Conversation
`break_pages_inserts` now takes the same `ResolvedRegion`s that
`break_pages_regions` does, so a longtable on a page with footnotes keeps
`\endhead`/`\endfoot` across a break. `\pagegoal` carries both charges at
once: `\LT@start` takes `\ht\LT@foot` off it (longtable.sty 229) and TeX's
insertion machinery takes `\skip\footins` and the notes (§1009), so a note
and a continuation foot compete for the same page; the insertion's own
fit-or-split test (§1010) sees the reserved foot too.
Two behaviours the no-footnote path never needed, both measured against
pdflatex on the new fixtures:
- longtable.sty 223 ends `\LT@start` with
`\ifdim\pageshrink>\z@\pageshrink\z@\fi`: the glue already on the page
(`\parskip`, `\LTpre`'s own `minus 4pt`, `\skip\footins`'s `minus 2pt`)
may no longer be shrunk to buy the table one more row. Without it the
builder squeezed r41 onto the first page of 99-longtable-footnote where
pdflatex stops at r40, and then `\@makecol` shrank `\LTpre` by 1.98 bp to
pay for it, lifting the whole table.
- `\LT@output` builds `\box\@cclv` as `\vbox{\unvbox\@cclv \copy\LT@foot
\vss}` and only then calls `\@makecol` (487-517), so the `\vss` sits
inside the body ahead of `\skip\footins`. It takes the column's whole
slack and pushes the note block to the foot of the page, leaving every
finite glue natural. Without it the footnote rule sat 11.49 bp too high.
The head and foot are materialised as vertical-list items of the page's
body rather than appended afterwards, which is what puts them through
`\@makecol`'s natural-size and glue-setting passes with the rest.
The `table_limitation` diagnostic for footnotes is gone; the float one
stays.
Gate: tabular oracle 101/101 with the bundled symlink-free font tree
(`apps/mac/Fonts` plus its three TFM directories), zero
font_unavailable/required_metrics_unavailable/ec_metrics_unavailable
diagnostics on every fixture. Fixtures 1-98 unchanged.
New fixtures (references from local TeX Live 2025, recorded in
`reference_engine`):
- 99-longtable-footnote: two-page table, note on the page the table starts
and breaks on.
- 100-longtable-footnote-after: note on the page the table ends on.
- 101-longtable-footnotes-three-pages: notes on the first and last of
three pages, so a continuation page carries head, rows and foot between
two note-bearing pages.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
`floatpage::paginate` takes the same `ResolvedRegion`s as the other two
page builders, so a longtable in a document with floats keeps
`\endhead`/`\endfoot` across a break. Inside a region the column goal
loses `\ht\LT@foot` and `\pageshrink` is zero (longtable.sty 229, 223);
a break inside one ends the page with `\LT@foot` and opens the next with
`\copy\LT@head`. A node the float machinery spliced in reports the list
index of the last real item, so `\@specialoutput`'s own penalties are
charged inside the region like any other.
One behaviour only this path has, measured against pdflatex on
103-longtable-float-deferred: `\LT@output` runs `\@makecol\@outputpage
\global\vsize\@colroom \copy\LT@head` and never `\@opcol`/`\@startcolumn`
(longtable.sty 513-516), so a page that continues a longtable gets no
float page tried and no deferred float added — the whole column is the
table's. With three `[t]` figures ahead of a two-page table, `topnumber`
keeps the third off page 1 and pdflatex does not put it at the top of
page 2 either; it stays deferred until `\end{document}`'s `\clearpage`
sets it on a float page of its own. Without `start_longtable_column` it
landed on page 2 and pushed the continuation head down 40.45 bp.
longtable.sty 489-491 makes a float or marginpar *inside* the table a
LaTeX error; that is now a targeted `table_limitation` naming the float,
and the blanket "in a document with floats" diagnostic is gone.
Gate: tabular oracle 103/103 with the bundled symlink-free font tree,
zero font/metric fallback diagnostics on every fixture. Fixtures 1-101
unchanged. `cargo test --release` (no `FLASHTEX_*` in the environment):
171 passed, 0 failed, `floats_oracle` included.
New fixtures (references from local TeX Live 2025):
- 102-longtable-float-top: a `[t]` figure above a two-page table.
- 103-longtable-float-deferred: three `[t]` figures, the third deferred
past the continuation page onto a float page.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…t found `\LTchunksize` (longtable.sty 65, default 200) is deliberately not modelled, with the reason and the measurements in `longtable.rs`. Chunking only ever narrows a chunk to the widest cell *seen so far*; longtable writes the final widths to the `.aux` (253-259) and warns `Column widths have changed`, so the next run sets every chunk at the maximum — which is what measuring the whole table once already produces. Verified on two shapes: 260 rows with the widest cell past the default 200-row boundary, and 30 rows with `\LTchunksize=5` and the widest cell in the sixth chunk. Both warn on pass 1, are silent on pass 2, and their two-pass references match this module's single measurement exactly. Modelling chunking would only reproduce the unconverged first pass. Building those two fixtures turned up three real mismatches, all measured against pdflatex: - **`\maxdepth\z@` does reach the page a table opens.** `\LT@start` sets it (longtable.sty 230) on the outer vertical list after `\LT@echunk` has closed the first chunk but before `\unvbox\z@` contributes any row, so §987 `freeze_page_specs` copies the zero into `page_max_depth` exactly when the table's first row is also the page's first box. A table under existing material finds it already frozen at `\@maxdepth`, and every later page of the table gets `\@maxdepth` back from `\@makecol`, so only the page a table *opens* is affected — which is why the earlier fixtures, all of which have a paragraph above the table, never saw it. 104-longtable-chunk-boundary begins with the table and loses one row on its first page. - **`\copy\LT@head`, not `\box`.** Without `\endfirsthead` the opening head *is* `\LT@head` (239), and without `\endlastfoot` the closing foot *is* `\LT@foot` (506), so the same cells are set twice. The piece builder removed each cell's block from the map, so the second use — the box the output routine repeats — kept its rules and lost its text. The repeated head and foot of every table written with only `\endhead` and `\endfoot`, a very common shape, were blank. - **The closing foot does not set `\prevdepth`.** `\box\ifvoid\LT@lastfoot \LT@foot\else\LT@lastfoot\fi` is inside `\LT@output` (506), and the output routine builds its own vertical list (§1025 `push_nest`) whose `prev_depth` §1026 discards when it hands the material back to the contribution list. Only `\LT@start`'s opening head runs on the outer list, so that is what the table leaves behind; with no head at all the value is unchanged, as this lane's predecessor measured. A probe with the same table after a paragraph with and without a descender puts the following paragraph at the same distance both times, so the value is fixed rather than inherited, and 4.34 pt below where `\dp\LT@foot` would put it. The earlier fixtures all end in `\hline\hline`, whose depth is zero, so `Fixed(closing)` and `Fixed(opening)` agreed on every one. Gates: tabular oracle 106/106 (all 98 pre-existing unchanged), zero font/metric fallback diagnostics and zero `table_limitation` on every fixture; amsmath 59/59; `cargo test --release` (no `FLASHTEX_*` in the environment) 171 passed, 0 failed; HW1/HW2 byte-identical to the #176 baseline, 3 pages and 692/698 items each, 0 errors, 0 overfull, 0 font diagnostics; real-world corpus identical to the baseline on all nine fixtures. New fixtures (references from local TeX Live 2025): - 104-longtable-chunk-boundary: 210 rows, widest cell past the default chunk boundary, table opening page 1. - 105-longtable-ltchunksize: `\LTchunksize=5`, widest cell in chunk six. - 106-longtable-head-foot-only: `\endhead`/`\endfoot` and nothing else. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
This was referenced Sep 13, 2026
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
render-pipeline: longtable regions through footnote and float pagination (rebase of #184 onto current main)
This was referenced Sep 15, 2026
Contributor
Author
|
Closing as superseded — the work is already on Replacement: d837c29 (PR #253) 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.
Follow-up to draft #176, which named this as the clear next task: a longtable
was set correctly on a page with footnotes or in a document with floats, but its
region was not carried through
break_pages_inserts/floatpage::paginate, soa break inside such a table lost
\endhead/\endfoot. Both diagnostics are nowgone and the region goes through all three page builders.
SHAs
agent/kabir-claude/longtable-inserts:46dae865.agent/kabir-claude/table-packages@18e442f7, not main.This was unavoidable:
crates/render-pipeline/src/longtable.rs,pagebuild::Region/ResolvedRegionandBlock::LongTableexist only on thatbranch, and this task is entirely about feeding those types to two more page
builders. Merge render-pipeline: longtable, multirow, cmidrule trims and colortbl fills #176 (and its compiler side compiler: longtable, multirow, booktabs extras and colortbl colours in tables #173) first.
e84b9885copied intocrates/render-pipeline/vendor/compiler(PINpreserved, never committed —git diff 18e442f7 HEAD --name-only | grep vendoris empty).Machine note. NixOS PC, TeX Live 2025, not MacTeX. No committed reference was
regenerated; the eight new fixtures carry TeX Live 2025 in
reference_engine.Every gate ran against the repository's bundled symlink-free font tree
(
apps/mac/Fontsplus its three TFM directories) and is asserted free offont_unavailable/required_metrics_unavailable/ec_metrics_unavailable—all 106 tabular rows carry zero.
cargo testfor this crate ran with noFLASHTEX_*in the environment, as its four without-NewCM control tests require.Done
Footnotes —
break_pages_inserts_regions(34997b8a)\pagegoalcarries both charges at once:\LT@starttakes\ht\LT@footoff it(longtable.sty 229) and TeX's insertion machinery takes
\skip\footinsand thenotes (§1009), so a note and a continuation foot compete for the same page. The
insertion's own fit-or-split test (§1010) sees the reserved foot too. The head
and foot are materialised as vertical-list items of the page's body rather than
appended afterwards, which is what puts them through
\@makecol's natural-sizeand glue-setting passes with the rest.
Two behaviours the no-footnote path never needed, both measured, not derived:
\LT@startwith\ifdim\pageshrink>\z@\pageshrink\z@\fi: the glue already on the page(
\parskip,\LTpre's ownminus 4pt,\skip\footins'sminus 2pt) may nolonger be shrunk to buy the table one more row. Without it the builder squeezed
r41 onto the first page of
99-longtable-footnotewhere pdflatex stops at r40,and
\@makecolthen shrank\LTpreby 1.98 bp to pay for it, lifting thewhole table.
\LT@output's\vss. It builds\box\@cclvas\vbox{\unvbox\@cclv \copy\LT@foot \vss}and only then calls\@makecol(487-517), so the\vsssits inside the body ahead of
\skip\footins. It takes the column's wholeslack and pushes the note block to the foot of the page, leaving every finite
glue natural. Without it the footnote rule sat 11.49 bp too high.
Floats —
floatpage::paginate(6f1a89b6)Same region contract. A node the float machinery splices in reports the list
index of the last real item, so
\@specialoutput's own penalties are chargedinside the region like any other.
One behaviour only this path has:
\LT@outputruns\@makecol\@outputpage \global\vsize\@colroom \copy\LT@headand never\@opcol/\@startcolumn(513-516), so a page continuing a longtable gets no float page tried and no
deferred float added — the whole column is the table's. With three
[t]figuresahead of a two-page table,
topnumberkeeps the third off page 1 and pdflatexdoes not put it at the top of page 2 either; it stays deferred until
\end{document}'s\clearpagesets it on a float page of its own. Withoutstart_longtable_columnit landed on page 2 and pushed the continuation headdown 40.45 bp.
longtable.sty 489-491 makes a float or marginpar inside the table a LaTeX
error; that is now a targeted
table_limitationnaming the float, replacing theblanket "in a document with floats" one.
\LTchunksize— scoped out, with the reason in the code (46dae865)Explicitly not modelled, documented in
longtable.rs. Chunking only evernarrows a chunk to the widest cell seen so far; longtable writes the final
widths to the
.aux(253-259) and warnsColumn widths have changed, so thenext run sets every chunk at the maximum — which is what measuring the whole
table once already produces. Verified on two shapes: 260 rows with the widest
cell past the default 200-row boundary, and 30 rows with
\LTchunksize=5and thewidest cell in the sixth chunk. Both warn on pass 1, are silent on pass 2, and
their two-pass references match this module's single measurement to the last
decimal. Modelling chunking would only reproduce the unconverged first pass,
which is not what a document renders as.
Three longtable bugs those two fixtures exposed (
46dae865)All measured against pdflatex. None is reachable from #176's own fixtures, which
is why they survived 98/98.
\maxdepth\z@does reach the page a table opens.\LT@startsets it (230)on the outer vertical list after
\LT@echunkhas closed the first chunk butbefore
\unvbox\z@contributes any row, so §987freeze_page_specscopies thezero into
page_max_depthexactly when the table's first row is also thepage's first box. A table under existing material finds it already frozen at
\@maxdepth, and every later page gets\@maxdepthback from\@makecol— soonly the page a table opens is affected. render-pipeline: longtable, multirow, cmidrule trims and colortbl fills #176's note that the zero "never
reaches the page" holds for its own fixtures, all of which have a paragraph
above the table;
104-longtable-chunk-boundarybegins with the table and losesone row on page 1.
\copy\LT@head, not\box. Without\endfirstheadthe opening head is\LT@head(239), and without\endlastfootthe closing foot is\LT@foot(506), so the same cells are set twice. The piece builder removed each cell's
block from the map, so the repeated box kept its rules and lost its text: the
repeated head and foot of every table written with only
\endheadand\endfoot— a very common shape — were blank.\prevdepth.\box\ifvoid\LT@lastfoot \LT@foot\else\LT@lastfoot\fiis inside\LT@output, and the output routinebuilds its own vertical list (§1025
push_nest) whoseprev_depth§1026discards when it hands the material back to the contribution list. Only
\LT@start's opening head runs on the outer list, so that is what the tableleaves behind; with no head at all the value is unchanged, as render-pipeline: longtable, multirow, cmidrule trims and colortbl fills #176 measured. A
probe running the same table after a paragraph with and without a descender
puts the following paragraph at the same distance both times — so the value is
fixed rather than inherited — and 4.34 pt below where
\dp\LT@footwould putit. render-pipeline: longtable, multirow, cmidrule trims and colortbl fills #176's fixtures all end in
\hline\hline, whose depth is zero, soFixed(closing)andFixed(opening)agreed on every one of them.Gates
Baseline is #176 @
18e442f7with the same vendored compiler, built into ascratch tree so both sides differ only in this branch's commits.
18e442f7)font_unavailable/required_metrics_unavailable/ec_metrics_unavailabletable_limitationcargo test --release, crates/render-pipeline (noFLASHTEX_*)--no-oracle --no-pixels)The two
ec_metrics_unavailablerows in the corpus (article-twocolumn,input-bibliography, missingectt*in the bundledjknappen/ectree) arepresent on the baseline too — the pre-existing gap #176 reported, untouched here.
New fixtures (8)
Footnotes:
99-longtable-footnote(two-page table, note on the page the tablestarts and breaks on),
100-longtable-footnote-after(note on the page the tableends on),
101-longtable-footnotes-three-pages(notes on the first and last ofthree pages, so a continuation page carries head, rows and foot between two
note-bearing pages).
Floats:
102-longtable-float-top(a[t]figure above a two-page table),103-longtable-float-deferred(three[t]figures, the third deferred past thecontinuation page onto a float page).
Chunking and shapes:
104-longtable-chunk-boundary(210 rows, widest cell pastthe default chunk boundary, table opening page 1),
105-longtable-ltchunksize(\LTchunksize=5, widest cell in chunk six),106-longtable-head-foot-only(\endhead/\endfootand nothing else).Known limitations (reported, not silent)
unsupported_block—footnotes::preparereturnsNonewhen floats arepresent, so
floatpage::paginatenever sees anInsertions. That is thefloats lane's gap, unchanged by this PR and orthogonal to the region work; the
region is carried through both builders independently, so wiring insertions
into
floatpageis all that is missing to combine them.\LT@start's other branch —\ifdim\pagetotal<\pagegoal\elsea\kern\pageshrink \penalty 9999 \kern-\pageshrink(209-212), and\vfil\breakwhen the head,first row and foot cannot fit at all (221) — is not modelled. It only matters
for a table starting on an already-full page.
\LT@start's\global\@colroom\@colht(225) discards a float reservation forlater pages. Not reachable while continuation pages take no floats, but it
would matter if a longtable ended mid-page and a float then landed on that
page.
\LTchunksizeas above: scoped out with evidence, not forgotten.Next
vendor/compilerto compiler: longtable, multirow, booktabs extras and colortbl colours in tables #173 once it merges and drop the local swap.floatpage::paginate, which would close the last combinedcase (footnotes and floats and a longtable).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu