Repository navigation
Conversation
…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).
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
added a commit
that referenced
this pull request
Sep 13, 2026
…ement and colortbl fills (tabular oracle 59/59 + 18/20 new) Implements table.rs layout for the compiler fields of #173: kill rows, booktabs' \@BTrule/\@BTendrule/\@xcmidrule rule classes (specialrule and addlinespace as class 2, \cmidrulesep after \morecmidrules), explicit cmidrule kerns, \arrayrulecolor on every rule kind, \doublerulesepcolor gaps, and colortbl fills per \CT@@Do@color (cell over row over column, overhangs from \col@sep then column then row). typeset: multirow boxes per multirow.sty 168-201, fills painted under the entries, colours resolved by a minimal xcolor stand-in (tablecolor.rs) until #150 lands. The tabular oracle compares rule and fill colours; fixtures 60-79 with MacTeX 2026 references. Needs vendor/compiler re-pinned to #173. longtable follows. 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
added a commit
that referenced
this pull request
Sep 13, 2026
Two facts measured against pdflatex, not derived from the package source:
- `\prevdepth` after a longtable. `\LT@array` builds each chunk in a
`\vbox` and `\endlongtable`/`\LT@ntabularcr` `\unvbox` it into the
page's vertical list (longtable.sty 252, 322, 334); `\unvbox` never
sets `\prevdepth`, so only the boxes the package appends itself —
`\box\LT@firsthead` (239) and `\box\LT@lastfoot` (506) — do. A table
with no head and no foot leaves `\prevdepth` as the material before it
had it. `VBlock::depth_after` says which. Without this the paragraph
after a headless longtable sat 4.35pt (the `\@arstrutbox` depth) too
high.
- `\LT@start`'s `\maxdepth\z@` (230) does not reach the page. TeX froze
`page_max_depth` when the page's first box landed (§987) — before
`\LT@start` runs for a table that starts mid-page — and `\@makecol`
ends every page with `\global\maxdepth\@maxdepth`, so continuation
pages freeze the class value again. Instrumenting `\LT@output` on a
three-page longtable shows `maxdepth=0pt` only on the first call and
`6.0pt` after; honouring the zero lost one row per continuation page.
The page goal is still reduced by `\ht\LT@foot`, which is what decides
the break.
Corpus: 12 longtable fixtures (80-91) — plain, the four terminators,
two- and three-page breaks with a repeating head and foot, `[l]`/`[r]`,
`\setlength\LTleft`, `\LTpre`/`\LTpost`, `\kill`, `\\*`, booktabs rules
and a wrapping `p{}` column with vertical rules. Their references were
generated on this machine with **TeX Live 2025** (recorded in each
`reference_engine` field), not MacTeX; every committed MacTeX reference
(fixtures 1-79) was checked to be reproduced byte for byte by the local
pdflatex first, and none was rewritten. `oracle.py` now accepts a
fixture with more than one page, which a longtable needs.
Gates on this machine:
- Tabular oracle 91/91 (was 79/79 over 79 fixtures; the 12 new ones all
pass and none of the old ones changed).
- amsmath corpus 59/59, identical to the main build (bffd168).
- HW1/HW2 rendering-v2 display lists byte-identical to the main build,
0 errors, 0 overfull.
- `tools/real-world-corpus/run.py --no-oracle --no-pixels`: same status
and page count on all 9 fixtures; one diagnostic fewer
(`packages booktabs are recognised but not implemented`, which the
#173 compiler now implements).
- `cargo test --release` on crates/render-pipeline: 30 test binaries,
all green.
Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary)
Commit-Executor: claude-opus-5
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
added a commit
that referenced
this pull request
Sep 13, 2026
`\LT@makecaption` (longtable.sty 475-485) is `\LT@mcol\LT@cols c{\hbox
to\z@{\hss \parbox[t]\LTcapwidth{...}\hss}}`: a row of the alignment like
any other, so it takes the `\@arstrut`, holding a zero-width box centred
on the table, so however wide the caption is it never widens a column.
Inside the parbox the whole caption goes on one centred line when it fits
(`\hbox to\hsize{\hfil\box\@tempboxa\hfil}`) and is set as a paragraph
otherwise, closed by `\endgraf\vskip\baselineskip`. `\parbox[t]` is a
`\vtop`, so `CaptionBox::height` is the first line's height and `depth`
is everything below it, the closing `\baselineskip` included.
`\caption` prefixes `\fnum@table` = `\tablename~\thetable` and a colon;
the tie is a non-breaking space and the space after the colon carries
TeX's space factor (`\sfcode`\:` = 2000), so it takes the face's
`\fontdimen7`. Without that the centred line was 1.3pt narrow and every
word of it sat 0.65bp off. `\caption*` drops the prefix. `\LTcapwidth`
is read from `\setlength`.
The caption of `\endhead` repeats at the top of every continuation page
with the rest of the head; `chunk_geometry` now renumbers a caption's
entry index back to the whole table's, without which the head's caption
was built but never painted.
Corpus: 6 more fixtures (92-97) — a short caption, one wrapping in the
4in parbox, `\caption*`, a first-head and an `\endhead` caption over a
page break, two longtables each stepping the `table` counter, and a
narrowed `\LTcapwidth`. References generated here with TeX Live 2025
(recorded in `reference_engine`); no committed MacTeX reference touched.
Gates on this machine:
- Tabular oracle 97/97 (18/18 longtable, fixtures 1-79 unchanged).
- amsmath corpus 59/59, identical to the main build (bffd168).
- HW1/HW2 rendering-v2 display lists byte-identical to the main build,
0 errors, 0 overfull.
- Real-world corpus (`--no-oracle --no-pixels`): same status and page
count on all 9 fixtures; one diagnostic fewer, the booktabs package
note the #173 compiler resolves.
- `cargo test --release` on crates/render-pipeline: 30 binaries green.
Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary)
Commit-Executor: claude-opus-5
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
added a commit
that referenced
this pull request
Sep 13, 2026
longtable.sty 135-137 redefines `\newpage` as `\noalign{\break}`, an
eject penalty between rows; the compiler reports it as
`Entry::PageBreak`, which the pipeline now turns into a zero-extent glue
unit carrying `\penalty-\@M` before the next row. The region's foot and
head go in at that break like any other, so the page ends with
`\LT@foot` and the next opens with `\LT@head`.
Fixture 98 (TeX Live 2025 reference, generated here): a two-page
longtable forced by `\newpage` after the third row. Tabular oracle
98/98; HW1/HW2 byte-identical to the main build; `cargo test --release`
on crates/render-pipeline 171 passed, 0 failed.
Also verified on this machine, for the record: PR #173's compiler
(`e84b9885`) builds and its whole suite passes here — 399 tests, 0
failed — with the repository's protocol/, tests/tex-corpus, docs/ and
apps/mac/Fonts alongside it.
Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary)
Commit-Executor: claude-opus-5
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
Paused for usage. Converts the compiler's new table fields (PR #173) into the pipeline's TableItem: row colour/nobreak/kill, cell colour/multirow, column colour, cmidrule kerns, addlinespace, specialrule, morecmidrules, rule colours, longtable sections/captions/page breaks, and the `||` doublerulesep gap as its own material. layout(), typeset's table_box and the tests are not updated yet, so the crate does not compile against the re-pinned compiler; it needs vendor/compiler re-pinned to 484cb11 (#173). 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
added a commit
that referenced
this pull request
Sep 14, 2026
…ement and colortbl fills (tabular oracle 59/59 + 18/20 new) Implements table.rs layout for the compiler fields of #173: kill rows, booktabs' \@BTrule/\@BTendrule/\@xcmidrule rule classes (specialrule and addlinespace as class 2, \cmidrulesep after \morecmidrules), explicit cmidrule kerns, \arrayrulecolor on every rule kind, \doublerulesepcolor gaps, and colortbl fills per \CT@@Do@color (cell over row over column, overhangs from \col@sep then column then row). typeset: multirow boxes per multirow.sty 168-201, fills painted under the entries, colours resolved by a minimal xcolor stand-in (tablecolor.rs) until #150 lands. The tabular oracle compares rule and fill colours; fixtures 60-79 with MacTeX 2026 references. Needs vendor/compiler re-pinned to #173. longtable follows. 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
added a commit
that referenced
this pull request
Sep 14, 2026
Two facts measured against pdflatex, not derived from the package source:
- `\prevdepth` after a longtable. `\LT@array` builds each chunk in a
`\vbox` and `\endlongtable`/`\LT@ntabularcr` `\unvbox` it into the
page's vertical list (longtable.sty 252, 322, 334); `\unvbox` never
sets `\prevdepth`, so only the boxes the package appends itself —
`\box\LT@firsthead` (239) and `\box\LT@lastfoot` (506) — do. A table
with no head and no foot leaves `\prevdepth` as the material before it
had it. `VBlock::depth_after` says which. Without this the paragraph
after a headless longtable sat 4.35pt (the `\@arstrutbox` depth) too
high.
- `\LT@start`'s `\maxdepth\z@` (230) does not reach the page. TeX froze
`page_max_depth` when the page's first box landed (§987) — before
`\LT@start` runs for a table that starts mid-page — and `\@makecol`
ends every page with `\global\maxdepth\@maxdepth`, so continuation
pages freeze the class value again. Instrumenting `\LT@output` on a
three-page longtable shows `maxdepth=0pt` only on the first call and
`6.0pt` after; honouring the zero lost one row per continuation page.
The page goal is still reduced by `\ht\LT@foot`, which is what decides
the break.
Corpus: 12 longtable fixtures (80-91) — plain, the four terminators,
two- and three-page breaks with a repeating head and foot, `[l]`/`[r]`,
`\setlength\LTleft`, `\LTpre`/`\LTpost`, `\kill`, `\\*`, booktabs rules
and a wrapping `p{}` column with vertical rules. Their references were
generated on this machine with **TeX Live 2025** (recorded in each
`reference_engine` field), not MacTeX; every committed MacTeX reference
(fixtures 1-79) was checked to be reproduced byte for byte by the local
pdflatex first, and none was rewritten. `oracle.py` now accepts a
fixture with more than one page, which a longtable needs.
Gates on this machine:
- Tabular oracle 91/91 (was 79/79 over 79 fixtures; the 12 new ones all
pass and none of the old ones changed).
- amsmath corpus 59/59, identical to the main build (bffd168).
- HW1/HW2 rendering-v2 display lists byte-identical to the main build,
0 errors, 0 overfull.
- `tools/real-world-corpus/run.py --no-oracle --no-pixels`: same status
and page count on all 9 fixtures; one diagnostic fewer
(`packages booktabs are recognised but not implemented`, which the
#173 compiler now implements).
- `cargo test --release` on crates/render-pipeline: 30 test binaries,
all green.
Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary)
Commit-Executor: claude-opus-5
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
`\LT@makecaption` (longtable.sty 475-485) is `\LT@mcol\LT@cols c{\hbox
to\z@{\hss \parbox[t]\LTcapwidth{...}\hss}}`: a row of the alignment like
any other, so it takes the `\@arstrut`, holding a zero-width box centred
on the table, so however wide the caption is it never widens a column.
Inside the parbox the whole caption goes on one centred line when it fits
(`\hbox to\hsize{\hfil\box\@tempboxa\hfil}`) and is set as a paragraph
otherwise, closed by `\endgraf\vskip\baselineskip`. `\parbox[t]` is a
`\vtop`, so `CaptionBox::height` is the first line's height and `depth`
is everything below it, the closing `\baselineskip` included.
`\caption` prefixes `\fnum@table` = `\tablename~\thetable` and a colon;
the tie is a non-breaking space and the space after the colon carries
TeX's space factor (`\sfcode`\:` = 2000), so it takes the face's
`\fontdimen7`. Without that the centred line was 1.3pt narrow and every
word of it sat 0.65bp off. `\caption*` drops the prefix. `\LTcapwidth`
is read from `\setlength`.
The caption of `\endhead` repeats at the top of every continuation page
with the rest of the head; `chunk_geometry` now renumbers a caption's
entry index back to the whole table's, without which the head's caption
was built but never painted.
Corpus: 6 more fixtures (92-97) — a short caption, one wrapping in the
4in parbox, `\caption*`, a first-head and an `\endhead` caption over a
page break, two longtables each stepping the `table` counter, and a
narrowed `\LTcapwidth`. References generated here with TeX Live 2025
(recorded in `reference_engine`); no committed MacTeX reference touched.
Gates on this machine:
- Tabular oracle 97/97 (18/18 longtable, fixtures 1-79 unchanged).
- amsmath corpus 59/59, identical to the main build (bffd168).
- HW1/HW2 rendering-v2 display lists byte-identical to the main build,
0 errors, 0 overfull.
- Real-world corpus (`--no-oracle --no-pixels`): same status and page
count on all 9 fixtures; one diagnostic fewer, the booktabs package
note the #173 compiler resolves.
- `cargo test --release` on crates/render-pipeline: 30 binaries green.
Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary)
Commit-Executor: claude-opus-5
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
longtable.sty 135-137 redefines `\newpage` as `\noalign{\break}`, an
eject penalty between rows; the compiler reports it as
`Entry::PageBreak`, which the pipeline now turns into a zero-extent glue
unit carrying `\penalty-\@M` before the next row. The region's foot and
head go in at that break like any other, so the page ends with
`\LT@foot` and the next opens with `\LT@head`.
Fixture 98 (TeX Live 2025 reference, generated here): a two-page
longtable forced by `\newpage` after the third row. Tabular oracle
98/98; HW1/HW2 byte-identical to the main build; `cargo test --release`
on crates/render-pipeline 171 passed, 0 failed.
Also verified on this machine, for the record: PR #173's compiler
(`e84b9885`) builds and its whole suite passes here — 399 tests, 0
failed — with the repository's protocol/, tests/tex-corpus, docs/ and
apps/mac/Fonts alongside it.
Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary)
Commit-Executor: claude-opus-5
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
…iler compiler: longtable, multirow, booktabs extras and colortbl colours in tables (rebase of #173 onto current main)
This was referenced Sep 15, 2026
compiler: accept \tabcolsep, \arrayrulewidth, \doublerulesep, \extrarowheight assignments (#56)
#526
Merged
Contributor
Author
|
Closing as superseded — the work is already on Replacement: 5baa9e6 (PR #250) 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.
Parses table packages beyond tabular/array into
crate::tabular(sources cited inline, TeX Live 2026):Tabular::longtable,[l|c|r],\endfirsthead/\endhead/\endfoot/\endlastfoot(Entry::Section),\caption[..]{..}/\caption*(Entry::Caption, table counter stepped per longtable),\kill(Row::kill),\\*(Row::nobreak),\newpage/\pagebreak(Entry::PageBreak);\setlengthof\LTleft/\LTright/\LTpre/\LTpost/\LTcapwidthaccepted.\multirow[vpos]{n}[bigstruts]{width|*|=}[vmove]{text}→Cell::multirow(also inside\multicolumn).\cmidrule(l{dimen}r)kerns,\addlinespace,\specialrule,\morecmidrules.xcolor[table]):\rowcolor[m]{c}[l][r],\cellcolor,>{\columncolor},\arrayrulecolor,\doublerulesepcolor— kept as written (ColorSpec); resolution belongs to the colour model (compiler: color/xcolor with pdfTeX-exact colour operators (982/982 oracle) #150).New public fields/variants are additive (
Row,Cell,ColumnTemplate,Tabular,Entry), so render-pipeline needs a vendor re-pin; the companion render-pipeline PR follows. apps/mac bundledsupported-latex.jsonneeds the usual sync.Tests:
cargo test --releaseall green (lib 256, incl. 4 new parser tests); supported inventory regenerated.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu