Repository navigation
render-pipeline: longtable regions through footnote and float pagination (rebase of #184 onto current main) - #253
Merged
Merged
Conversation
GoKubar
force-pushed
the
rebase/176-table-packages-pipeline
branch
from
September 14, 2026 02:22
331a3b3 to
b5351c5
Compare
`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
GoKubar
force-pushed
the
rebase/184-longtable-inserts
branch
from
September 14, 2026 02:30
197bc78 to
12cc8e4
Compare
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
`crates/render-pipeline` builds against `vendor/compiler`, not `../compiler`, so the longtable/multirow/booktabs/colortbl types #250 added to `crates/compiler/src/tabular.rs` are invisible to the pipeline until the mirror is re-exported. This is the re-pin #250, #251 and #253 each say is "deliberately not in any of these PRs (vendor is the integration lane's)"; both pipeline halves were measured against exactly this re-pin, locally. It rides with #251 rather than landing as its own PR (as #274's re-pin did) because it is not standalone-safe in either direction, verified on this tree against main 5baa9e6: - re-pin without #251: `cargo build --release` in crates/render-pipeline fails, `error[E0027]: pattern does not mention fields kern_left, kern_right` -- #250 grew `Entry::CMidRule` and `table.rs::from_compiler` matches `ct::Entry` exhaustively with no wildcard arm; - #251 without the re-pin: the same build fails on the types it is written against (`ct::Longtable`, `ct::Multirow`, `ct::ColorFill`, `ct::Entry::SpecialRule`/`Section`/`PageBreak`/...), which is what #251's own `rust render-pipeline` and `rust flashtex-cli` CI jobs show. Either half alone leaves main red, so they land in one merge. `git archive 5baa9e6 crates/compiler`, byte-identical to the real crate apart from `PIN` (verified by re-archiving the previous pin 2495ebf and diffing against the committed mirror: only `PIN` differed). Implementation-Agent: integration lane (linux-primary, NixOS) Commit-Executor: Claude Opus 5 via Claude Code (direct-agent Git under the observed-Cursor-limit user override) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
changed the base branch from
rebase/176-table-packages-pipeline
to
main
September 14, 2026 06:01
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.
Rebase of #184 (
agent/kabir-claude/longtable-inserts) onto currentmain, on top of #251. Supersedes #184 — its branch is untouched.longtable regions through the footnote page builder and float pagination,
\LTchunksizescoped out, plus the three longtable fixes that scoping found. Base chain: #250 (compiler) → #251 (pipeline) → this.All three commits cherry-picked cleanly onto the rebased #251; the integration work was all in #251.
Gates, measured on this tree
Control is
main@5e6c65bewith its own committed vendor pin; this branch was measured withvendor/compilerlocally re-pinned to #250 (not committed — vendor is the integration lane's).oracle.py check)cargo test --test tabular_oracle)crates/render-pipelinecargo test --release106/106is now asserted bycargo test, not only by the corpus's ownoracle.py— see #251 for why that was not previously true.Fonts throughout:
FLASHTEX_FONT_DIRS=apps/mac/Fonts,FLASHTEX_TFM_DIRSat itslm/jknappen/ec/amsfonts/symbolsmetrics. No committed oracle data was regenerated.Rebased and re-measured against
main5e6c65be.mainmoved 53 commits during this work, including changes toparser.rs,typeset.rsandmathtex.rs; every number in this PR is from the final tree, not the earlier base.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu