Repository navigation
compiler: siunitx S[...] and s table columns (#324) - #331
Merged
Merged
Conversation
siunitx loads array.sty (siunitx.sty 9321), so it joins ARRAY_PACKAGES.
With siunitx loaded, S[<options>] and s[<options>] are read as one column
specification item instead of one illegal character per letter. Both are
centred columns; plain numeric S entries are typeset through \num with the
column's options (table-* layout keys dropped) and plain s entries through
\unit. Braced, blank and command-bearing entries stay text, as siunitx sets
{...} entries. Decimal-marker alignment is not implemented and is reported
once per specification.
Clears every column-specification error in fixtures/real-world
siunitx-tables and lab-report. Syncs the Mac supported-latex.json copy,
which was stale since #251.
Refs #324
Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro)
Commit-Executor: daniel-vpclaude (direct git)
Co-authored-by: d-q222 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ
Contributor
Author
|
Suite rerun on the final commit 821eb8a: full |
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
`main` advanced by 16 commits while the first re-pin was being measured, five of them in `crates/compiler`, so `c1ae760d` was already stale. Re-exported at `e44d5917`, which also carries #339 (`\langle`/`\rangle` as U+27E8/U+27E9 mathopen/mathclose -- the corpus's `twelvept-plain` fixture was reporting "no math glyph for '<'" and drawing an empty box), #321 (`\pagestyle`, `\thispagestyle`, `\pagenumbering` in the preamble), #244 (`\maketitle` without `\author`), #314 (`\odot`/`\ominus`/`\oslash`/`\bigcirc` as binary operators) and #331 (siunitx `S[...]`/`s` columns) on top of #380's natbib. Byte-identity re-verified at the new SHA the same two ways: the vendored tree's path/mode/blob-SHA listing matches `git ls-tree -r e44d591:crates/compiler` on all 555 files, and `diff -r --exclude=PIN` against a fresh re-extraction is empty. The no-other-directory-needs-re-pinning finding was re-checked against the new `main` rather than carried over: `math-layout`, `paragraph-layout`, `microtype`, `document-style`, `font-resources`, `tex-text-encoding`, `tex-boxes`, `tex-expansion` and `vector-graphics` are still byte-identical to `main`'s crates, and `font-engine`/`pdf`/`project-files` still differ only by their own rows' deliberate choices. Gates re-run at this pin, same font environment: cargo test --release on crates/render-pipeline 254 passed, 0 failed, 2 ignored amsmath corpus 59/59 within 0.5 bp tabular corpus 106/106 (words 0.5 bp, rules 0.1 bp) HW1 render 3 pages, 0 errors HW2 render 3 pages, 0 errors Zero font-failure diagnostics on either HW document; the only diagnostics remain `math_resource_profile` (4 on HW1, 7 on HW2), which are informational. PR #385 (hyperref/`\hypersetup` and url.sty URL breaking) is still OPEN and so is still deliberately absent from this pin. Implementation-Agent: Claude Opus 5 (lane nixos-vendor-repin, linux-primary) Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit) Co-authored-by: GoKubar <[email protected]>
This was referenced Sep 14, 2026
compiler: accept
hyperref and \hypersetup, and break URLs the way url.sty does (rebase of #385)
#388
Merged
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
… natbib (#386) * render-pipeline: re-pin vendor/compiler to main so the corpus can see natbib `crates/render-pipeline/vendor/*` are frozen `git archive` snapshots, so a compiler-side change is invisible to `flashtex-render` -- and therefore to the whole rendered corpus -- until the pin moves. `vendor/compiler` sat at `f9bab2a7` (PR #267), one `crates/compiler` commit behind: PR #380 (`dd4a9809`, natbib citations and the `\bibitem[Author(Year)]` labels behind them). #381 had already landed the render-pipeline half against the live crate, so the corpus's `natbib-review` fixture was being measured against a pipeline whose vendored compiler still could not parse `\citep`/`\citet`. Re-exported from `main` at `c1ae760d`: git archive c1ae760:crates/compiler | tar -x -C vendor/compiler git rev-parse c1ae760 > vendor/compiler/PIN Byte-identity verified two independent ways: a path/mode/blob-SHA listing of the vendored tree matches `git ls-tree -r c1ae760:crates/compiler` on all 553 files, and `diff -r --exclude=PIN` against a fresh re-extraction is empty. PR #385 (hyperref/`\hypersetup` and url.sty URL breaking -- the rebase of the closed #379) was still OPEN when this pin was taken, so it is deliberately not carried here: a vendor pin never holds an unmerged branch. It will arrive with the next re-pin after it merges. No other vendor directory needed re-pinning, and this was checked rather than assumed. `crates/compiler`'s own path dependencies at `c1ae760d` are `font-engine`, `tex-text-encoding`, `tex-boxes` and `tex-expansion`; a recursive diff of every vendor directory against `main`'s crate of the same name shows `math-layout`, `paragraph-layout`, `microtype`, `document-style`, `font-resources`, `tex-text-encoding`, `tex-boxes` and `tex-expansion` already byte-identical to `main`. `font-engine`, `pdf` and `project-files` do differ, but each by its own VENDORING.md row's deliberate choice, and none of those deltas is an API the new compiler needs -- the build and the full test run below confirm it. Also noted in the VENDORING.md row: that table's `compiler` and `math-layout` cells still name `ea4ee5c8`, while the `PIN` files held `f9bab2a7` and `9a82257b`. The table had drifted behind `PIN`; `PIN` is the authority. Only the `compiler` row is corrected here, and by prepending -- the old log text is kept intact. Gates, all with `FLASHTEX_FONT_DIRS`/`FLASHTEX_TFM_DIRS` set to `apps/mac/Fonts` and its lm + jknappen/ec + amsfonts/symbols TFM trees: cargo test --release on crates/render-pipeline 249 passed, 0 failed, 1 ignored amsmath corpus 59/59 within 0.5 bp tabular corpus 106/106 (words 0.5 bp, rules 0.1 bp) HW1 render 3 pages, 0 errors HW2 render 3 pages, 0 errors Zero font-failure diagnostics on either HW document. The only diagnostics are `math_resource_profile` (4 on HW1, 7 on HW2), which report that Latin Modern Math supplies one 10 pt design for several optical sizes -- informational, not a failure, and unchanged by this re-pin. Implementation-Agent: Claude Opus 5 (lane nixos-vendor-repin, linux-primary) Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit) Co-authored-by: GoKubar <[email protected]> * render-pipeline: move the vendor/compiler pin forward to current main `main` advanced by 16 commits while the first re-pin was being measured, five of them in `crates/compiler`, so `c1ae760d` was already stale. Re-exported at `e44d5917`, which also carries #339 (`\langle`/`\rangle` as U+27E8/U+27E9 mathopen/mathclose -- the corpus's `twelvept-plain` fixture was reporting "no math glyph for '<'" and drawing an empty box), #321 (`\pagestyle`, `\thispagestyle`, `\pagenumbering` in the preamble), #244 (`\maketitle` without `\author`), #314 (`\odot`/`\ominus`/`\oslash`/`\bigcirc` as binary operators) and #331 (siunitx `S[...]`/`s` columns) on top of #380's natbib. Byte-identity re-verified at the new SHA the same two ways: the vendored tree's path/mode/blob-SHA listing matches `git ls-tree -r e44d591:crates/compiler` on all 555 files, and `diff -r --exclude=PIN` against a fresh re-extraction is empty. The no-other-directory-needs-re-pinning finding was re-checked against the new `main` rather than carried over: `math-layout`, `paragraph-layout`, `microtype`, `document-style`, `font-resources`, `tex-text-encoding`, `tex-boxes`, `tex-expansion` and `vector-graphics` are still byte-identical to `main`'s crates, and `font-engine`/`pdf`/`project-files` still differ only by their own rows' deliberate choices. Gates re-run at this pin, same font environment: cargo test --release on crates/render-pipeline 254 passed, 0 failed, 2 ignored amsmath corpus 59/59 within 0.5 bp tabular corpus 106/106 (words 0.5 bp, rules 0.1 bp) HW1 render 3 pages, 0 errors HW2 render 3 pages, 0 errors Zero font-failure diagnostics on either HW document; the only diagnostics remain `math_resource_profile` (4 on HW1, 7 on HW2), which are informational. PR #385 (hyperref/`\hypersetup` and url.sty URL breaking) is still OPEN and so is still deliberately absent from this pin. Implementation-Agent: Claude Opus 5 (lane nixos-vendor-repin, linux-primary) Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit) Co-authored-by: GoKubar <[email protected]>
This was referenced Sep 14, 2026
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
) The two halves of this tool disagreed about what a word is. `pdftext.py` built reference words from glyphs — breaking on a space, a new baseline, a new text object or a gap wider than 0.16 em, and explicitly *not* on a font change. `rank.py` built candidate words from `glyph_run` items, splitting only on space clusters *within* a run and never joining across runs. But a `glyph_run` is a typesetting artefact, not a word: the pipeline starts a new run at every face change. So one siunitx `S` cell arrived as three candidate words (`1`, `.`, `234`) against the reference's one (`1.234`) — because pdfTeX sets that cell as three `Tf`-switched runs inside one text object, and the reference's rule joins them. `difflib` then aligned the two sequences against each other and reported the disagreement as geometry. That is what made PR #331 (siunitx `S`/`s` columns) read as a regression it was not: `lab-report` page 2 went from 78 to 118 candidate words and 70 to 50 aligned, with the ink unchanged and correctly placed. Feeding the candidate's glyphs through `pdftext.words_from_glyphs` removes the disagreement by construction — there is now one definition of a word in this tool, in one function, used by both sides. `words_from_glyphs` gains `glyph_index`; a word's glyphs are always contiguous in its input, so `rank.py` carries `math` and the source span across the grouping without the grouper having to know about them. The reference path is otherwise untouched. Measured on all 22 real-world fixtures with one producer binary (`31b84428`), harness the only variable: aligned words 14135 -> 15040 (+905, +6.4%) dx 85.89% -> 85.33% dy 76.07% -> 75.08% both 70.03% -> 69.02% page counts 22/22 unchanged The percentages fall while the measurement gets better, and both facts are real. 905 more words now pair up, and they are disproportionately the hard ones — math and table material that previously could not align at all and so sat outside the denominator. Coverage rises, the average over a harder population falls. Sixteen fixtures gain aligned words, four are unchanged, two lose a handful. The two siunitx fixtures, which triggered this, land exactly on the reference: lab-report p2 cand 118 -> 70 (ref 71), aligned 50 -> 70 siunitx-tables p1 cand 388 -> 353 (ref 353), aligned 322 -> 345 siunitx-tables p2 cand 297 -> 275 (ref 275), aligned 257 -> 272 `lab-report` p2's worst delta drops from 91.75 bp to 0.01 bp. It also stops hiding stray ink, which is why `unicode-accents` loses one aligned word. That fixture has a run, `ellipsis\dots;`, whose last five glyphs sit at **x = -12321 bp** — about 12.3k bp left of the page. Grouping by run put all ten glyphs in one word whose `x` came from the first glyph, so the tool reported it as fine. Grouping geometrically splits at the backwards jump and the fragment keeps its own origin, and `unicode-accents` page 1 is now the corpus's top-ranked item at dx -12640.53. The defect is in the producer's display list, is present on `main` independently of this change (same bytes in both runs), and is not touched here — this commit only stops concealing it. `python3 -m unittest discover -s tools/visual-oracle -p 'test_*.py'`: 13 passed (was 8). A full `rank.py` run over the three affected fixtures produces its report unchanged in shape. Implementation-Agent: Claude Opus 5 (lane nixos-graphics-sectioning, linux-primary) Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
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.
Closes #324 (phase 1). Claim
GH-324, daniel-vpclaude (Claude Pro).Problem:
\begin{tabular}{l S[table-format=1.3]}was read one character at a time.S,[, and every letter oftable-format=1.3each reportedillegal character 'X' in the column specification, about 85 errors acrossfixtures/real-world/siunitx-tablesandlab-report.Change (
crates/compiler/src/parser/tabular.rs):\RequirePackage{array}, siunitx.sty v3.4.14 line 9321), sosiunitxjoinsARRAY_PACKAGES.S[<options>]/s[<options>]is oneSpecItem::Siunitx, a centred column (\@classz). A\newcolumntype{S}still wins, and without siunitxSis still an illegal character.Scolumn (words plus\pm/\mp/\times/\cdot) is typeset as\num[<options>]{…}, and a plainsentry as\unit. The synthesized tokens carry the entry's own spans.table-*keys are layout keys and are dropped before\num. Other keys reach the formatter, which warns as usual if a key isn't implemented.{Batch}), blank and command-bearing entries stay text.Evidence:
crates/compiler, JSON protocol): siunitx-tables and lab-report both have 0 column-spec errors, down from about 85 across the two on main. What remains is unrelated:table/\captionfloat errors and the fixture's deliberately empty\si{} and \SI{}prose.tests/siunitx_columns.rshas 5 tests. 4 fail without the fix; the no-siunitx control passes either way.tabularsupported-LaTeX description is updated and regenerated. The Macsupported-latex.jsoncopy is synced; it had been stale since render-pipeline: longtable, multirow, cmidrule trims and colortbl fills (rebase of #176 onto current main; + the gate that was not measuring them) #251 (colortbl/booktabs/longtable/multirow rows).Integration: this is compiler-only, so it reaches the app and CLI at the next vendor re-pin. It doesn't touch
vendor/.Phase 2, not in this PR:
table-formatwidths and decimal alignment in layout.🤖 Generated with Claude Code
https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ