Repository navigation
compiler: longtable, multirow, booktabs extras and colortbl colours in tables (rebase of #173 onto current main) - #250
Merged
Conversation
This was referenced Sep 14, 2026
…n tables
Parses the table packages beyond tabular/array into the structured table
(crate::tabular), citing the TeX Live 2026 sources:
- longtable.sty v4.24: the environment (only with the package loaded) as a
paragraph holding one Tabular with `longtable: Some(..)`; `[l|c|r]`;
`\endfirsthead`/`\endhead`/`\endfoot`/`\endlastfoot` as Entry::Section
markers; `\caption[short]{..}`/`\caption*` as Entry::Caption numbered by
the table counter every longtable steps (text up to the row's `\\`,
e.g. a `\label`, joins the caption); `\kill` rows (Row::kill); `\\*`
(Row::nobreak); `\newpage`/`\pagebreak` as Entry::PageBreak;
`\setlength` of `\LTleft`/`\LTright`/`\LTpre`/`\LTpost`/`\LTcapwidth`
accepted (read from the source by the pipeline).
- multirow.sty v2.9: `\multirow[vpos]{nrows}[bigstruts]{width|*|=}[vmove]{text}`
anywhere at the top level of an entry, including inside `\multicolumn`
(Cell::multirow; the text stays the entry's content).
- booktabs.sty v1.61803398: `\cmidrule(l{<dimen>}r)` explicit trims
(kern_left_pt/kern_right_pt), `\addlinespace[..]`, `\specialrule{w}{a}{b}`,
`\morecmidrules`.
- colortbl.sty v1.0k (or xcolor's `table` option): `\rowcolor[m]{c}[l][r]`
(Row::color; the right overhang copies the left), `\cellcolor[m]{c}`
(Cell::color), `>{\columncolor[m]{c}[l][r]}` (ColumnTemplate::color),
`\arrayrulecolor`/`\doublerulesepcolor` before a table (Tabular fields)
and between rows (Entry::RuleColor/DoubleRuleSepColor). Colours are kept
as written (ColorSpec model/spec): resolving them is the colour model's
job (PR #150).
Optional brackets glued to following text (`\rowcolor{x}[1pt][3pt]a`) are
split like `\\[2pt]Next`. The compiler's own layout honours kill rows,
cmidrule kerns, addlinespace, specialrule and captions; colour and page
breaking are the render pipeline's. Supported inventory regenerated
(booktabs, longtable, multirow, colortbl packages; \arrayrulecolor,
\doublerulesepcolor). apps/mac's bundled supported-latex.json needs the
usual sync. cargo test --release: all green (lib 256).
Rebased from the original base (bffd168) onto eea975c, 190 commits later.
Three things the branch did have to be rebuilt on what replaced them:
- The branch carried its own `equation_counter`/`figure_counter`/
`table_counter` fields. `main` has since replaced all three with
`crate::xref::Counters`, so the `table` counter every longtable steps is
now `self.counters.step("table")` -- which also means `\thetable` picks up
report/book's `\thechapter.` prefix and any `\numberwithin`/`\setcounter`
in force, where the branch's plain `u32` could not. `Longtable::number`
and `Entry::Caption::number` stay `u32` (the value, not the formatted
label) because the pipeline prefixes "Table n: " from it; for a class
whose `\thetable` is not plain arabic that prefix is still wrong, which
is a gap this PR does not close.
- `main` grew `parser/colors.rs` with its own `color_argument` resolving
`\color`/`\textcolor` against `crate::color::Colors`. The table one, which
keeps the colour as written, is `table_color_argument` now; the two are
genuinely different operations, not a duplicate.
- `\setlength` of the `\LT*` lengths joins the existing match arms rather
than replacing `fboxsep`/`fboxrule`, and the `xcolor[table]` -> colortbl
load joins `load_color_package` rather than replacing it. The recognised
package-option list keeps both siunitx/multicol and the four table
packages.
Measured on the rebased tree (not the numbers above, which predate it):
`cargo test --release` in crates/compiler, 40 test binaries, 0 failed;
lib 282 passed (main's baseline is 278, so the 4 new parser tests are the
whole delta). Supported inventory regenerated from this tree.
Rebase-Agent: Claude Opus 5 (engine lane, linux-primary)
Implementation-Agent: Claude Opus 5 (subagent kabir-claude table packages, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
booktabs evaluates \cmidrule(l{.5em}) and \addlinespace[1ex] in the font
where the rule is set, whose quad is not the body size (Latin Modern 12pt:
11.75pt). CMidRule::kern_left/kern_right and AddLineSpace::space are now
FontDimen { pt, em, ex }; resolve(em, ex) gives points. Found by tabular
oracle fixture 60 (0.249bp). cargo test --release: all green.
Implementation-Agent: Claude Opus 5 (subagent kabir-claude table packages, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
force-pushed
the
rebase/173-table-packages-compiler
branch
from
September 14, 2026 02:15
97906d9 to
6b533e8
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
pushed a commit
that referenced
this pull request
Sep 14, 2026
…ded without it) (#327) Fixes the red `sync-supported-latex.sh --check` gate on main: #250 regenerated the compiler inventory without running the sync script. Verified byte-identical to current main's crates/compiler/supported/supported-latex.json. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
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 #173 (
agent/kabir-claude/table-packages-compiler, dead at the head) onto currentmain. Original basebffd168a;mainhas moved 243 commits underneath it. Supersedes #173 — its branch is untouched.longtable, multirow, booktabs extras and colortbl colours parsed into
crate::tabular; see the commit messages for the construct list and the TeX Live 2026 sources.What the rebase actually had to rebuild
git cherry-pickconflicted inparser.rs(5 hunks),supported-latex.jsonanddocs/user/compiler.md. Three were genuine refactor collisions, not textual ones:equation_counter/figure_counter/table_counterfields;mainreplaced all three withcrate::xref::Counters. Thetablecounter every longtable steps is nowself.counters.step("table"), so\thetablepicks up report/book's\thechapter.prefix and any\numberwithin/\setcounter— which the branch's plainu32could not.Longtable::numberandEntry::Caption::numberstayu32(the value, not the label), because the pipeline prefixes"Table n: "from it. Known gap: for a class whose\thetableis not plain arabic that prefix is still wrong. The corpus is article-class, so no fixture exercises it.color_argumentcollision.maingrewparser/colors.rswith acolor_argumentthat resolves\color/\textcoloragainstcrate::color::Colors. The table one, which keeps the colour as written, is nowtable_color_argument. Two different operations, not a duplicate.\LT*\setlengtharms joinfboxsep/fboxrulerather than replacing them;xcolor[table]→ colortbl joinsload_color_package; the recognised-package-option list keeps siunitx/multicol and the four table packages.The two generated artefacts were regenerated from this tree with
crates/compiler/scripts/render_supported_latex.sh(they have a drift gate,tests/supported_latex.rs). No oracle data was regenerated.Gates, measured on this tree (not #173's stale numbers)
main@5e6c65be)crates/compilercargo test --release --no-fail-fastThe +4 are this branch's own parser tests. Fonts:
FLASHTEX_FONT_DIRS/FLASHTEX_TFM_DIRSatapps/mac/Fonts.Dependents
The pipeline half is #176 → rebased as
rebase/176-table-packages-pipeline, and #184 on top of that. Both needcrates/render-pipeline/vendor/compilerre-pinned to this branch; the re-pin is deliberately not in any of these PRs (vendor is the integration lane's). Both were measured against a local re-pin to this tree — see their PR bodies.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