Repository navigation
compiler: \not before any relation, as the zero-width \mathrel it is - #296
Conversation
`\not` was not in the inventory at all, so `$\not=$` reported
`\not is not supported in math mode` -- a red error in the Mac app -- and
typeset the five characters `\not` literally, 22.24 pt wide against
pdflatex's zero. Same for `\not<`, `\not\in`, `\not\subset`.
`\not` is not a symbol of its own. `fontmath.ltx` 432 is
`\mathchardef\not="3236`: class 3 (`\mathrel`), family 2 (cmsy), slot `"36`,
a glyph whose TFM advance is zero. TeX sets it in an empty box and the
relation that *follows* draws on top of it. So one `COMMAND_GLYPHS` row plus
one `symbol_class` row covers `\not` before **any** relation, and
`\ne`/`\neq`/`\notin` turn out to be the same two atoms already, spelled as
one control word.
* `math.rs`: `("not", "\u{0338}")` in `COMMAND_GLYPHS`, and U+0338 added to
`symbol_class`'s `Rel` arm. The class matters even though the glyph is zero
width: TeX puts no glue between two Rel atoms, so `\not=` comes out exactly
as wide as `=`; an Ord `\not` would open a 5 mu thick space in front of the
relation and `a\not=b` would be 5 mu wide of `a=b`.
* `lm_math.rs`: `('\u{0338}', 0)`. U+0338 is what Latin Modern Math draws the
slash at, and it carries cmsy10's zero advance there too --
`tests/lm_math_binding.rs` re-reads the pinned font program and confirms it.
Without the row the export guard
(`every_math_symbol_has_a_decided_export_outcome`) would refuse the new
`COMMAND_GLYPHS` entry as unrepresentable.
* Generated artefacts regenerated with
`crates/compiler/scripts/render_supported_latex.sh` (542 -> 543 math-mode
entries).
pdflatex TL2025 (pdfTeX 3.141592653-2.6-1.40.27) at 10 pt, `\hbox{$...$}`,
with `\hbox{$ab$}` = 9.57755 pt as the atom-class control. Every `\not` form
is exactly as wide as the relation it negates, and spaces as one relation:
| box | pdflatex | before | after |
|---|---:|---:|---:|
| `$\not=$` | 7.77780 | 30.01641 | 7.77800 |
| `$\not<$` | 7.77780 | 30.01622 | 7.77780 |
| `$\not\in$` | 6.66669 | 28.90511 | 6.66669 |
| `$\not\subset$` | 7.77780 | 30.01622 | 7.77780 |
| `$=$` (control) | 7.77780 | 7.77800 | 7.77800 |
| `$\in$` (control) | 6.66669 | 6.66669 | 6.66669 |
Atom class, measured not assumed: `a\not<b`, `a\not\in b`, `a\not\subset b`
sit 13.33322 / 12.22210 / 13.33322 pt over the `ab` control, which is the
glyph's own width plus 2 x 5 mu -- Rel on both sides, residual 0.00015 pt.
The `\not is not supported in math mode` error is gone.
New `not_is_a_zero_width_relation_the_following_relation_overprints` pins
both halves through this crate's own layout: `\not=`/`\not<`/`\not\in`/
`\not\subset` equal to `=`/`<`/`\in`/`\subset`, `a\not=b` equal to `a=b`,
`a\not\in b` equal to `a\in b`, and the slash and the relation both at x 0.
It deliberately does **not** compare `a\neq b`: this crate's own v1 layout
sets `\neq` as the single precomposed U+2260 glyph (778 units), 0.27 pt
narrower than `=` at 18 pt. That is a property of the v1 layout only -- the
render pipeline decomposes U+2260 back into the two atoms and measures
`$a \neq b$` at pdflatex's 22.91077 pt exactly.
**This does not reach the CLI or the Mac app on its own.** Both link
`crates/render-pipeline/vendor/compiler`, a frozen mirror, so
`vendor/compiler` must be re-pinned past this commit before `\not` renders --
no vendor file is touched here, and that re-pin belongs to the vendoring
owner. The pipeline half (a `symbol_atoms` arm turning a bare U+0338 into one
Rel atom, so math-layout's `default_class` does not make the combining
character Ord) is the sibling render-pipeline PR, which also fixes where the
slash is *painted* -- that was the actual owner-visible `\ne`/`\neq` defect.
End-to-end verification of all three pieces used a throwaway local copy of
these two files into `vendor/compiler`, reverted and never committed; the
numbers above are from that run.
Gates, NixOS linux-primary, bundled `apps/mac/Fonts`, `FLASHTEX_TFM_DIRS` =
`public/lm:jknappen/ec:public/amsfonts/symbols`, `CARGO_BUILD_JOBS=4`. Zero
font-FAILURE diagnostics (`font_unavailable`, `required_metrics_unavailable`,
`ec_metrics_unavailable`, `font_outline_substituted`, `tfm_missing`,
`math_font_unavailable`):
| gate | control (origin/main) | this branch |
|---|---|---|
| compiler suite | 485 passed, 0 failed | 486 passed, 0 failed |
| render-pipeline suite | 213 passed, 0 failed | 213 passed, 0 failed (vendor pin unchanged) |
| math-layout suite | 66 passed, 0 failed | 66 passed, 0 failed (untouched) |
| amsmath corpus | 59/59 within 0.5 bp | 59/59 |
| amssymb corpus | 38/39 (`32-braces-narrow`) | 38/39 (same one) |
| HW1 / HW2 | 3 pages, 0 errors, 0 overfull | same |
| real-world corpus (22 fixtures) | status/pages/diagnostic sets | identical to control |
The corpus ran `--no-oracle --no-pixels`: this machine has neither MacTeX nor
a rasteriser, so that comparison is status/pages/diagnostics, not pixels.
Implementation-Agent: Claude Opus 5 (engine lane, linux-primary / NixOS)
Commit-Executor: Claude Opus 5 via Claude Code (direct-agent Git execution
under the observed-Cursor-limit user override)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
d9ba437 to
73d33e5
Compare
|
Rebased onto current main ( Conflicts were stale-only, both in generated output. Gates on the rebased tree: compiler suite 493 passed, 0 failed, including One correction to how this PR gets read. The body's framing is right and worth restating, because it changes the merge order: this PR does not fix the owner-reported
Merging both now so the re-pin picks them up together. |
…ests only) (#668) The output-identity gate is a hard fail, and main itself has been failing it: the committed digests predate #295/#296 (negated relations) and #649 (list label and item-text geometry, /ActualText groups), so every PR touching layout tripped a gate that main could not pass either. Re-recorded on the reference host at main 35ead1c over the full 26-case corpus. 14 cases move, 116 digest values in all; 12 are byte-identical, including both synthetic documents and math-heavy/tikz-heavy. ONLY the per-case `digests` maps change. `meta`, `targets`, every per-case `metrics` map and `load1_max` are byte-identical to #206's capture, verified field by field -- no timing number here is claimed to have been measured on this host, and none has been replaced. Attribution, by re-recording at 44b21ad (main immediately before #649) and diffing both ways: pre-#649 (#295 \ne paint position, #296 \not as a zero-width \mathrel): hw2, inline-math, math-sheet, ps-calculus, twelvept-plain -- every corpus document containing \ne, \neq or \not, which is two more than a \ne-only grep finds. #649 (#611/#625/#628 list label and item-text offsets; #614 /ActualText): cv, enumitem-worksheet, hyperref-toc, lab-report, lecture-notes, listings-manual, lmodern-report, plain-article, ps-calculus, thesis-chapter, twelvept-plain. The changed set is exactly the documents using itemize/description or a negated relation. hw1 is unchanged and uses only enumerate, which the list work did not move; lecture-notes changed only its export.pdf and v2 keys, from #614 grouping the \gcd/\lcm multi-glyph runs. Digests are independent of --runs: a control at --runs 5 (CI's setting) over hw1, math-sheet and plain-article reproduces the --runs 1 digests exactly. Gate after the re-record, at main, full corpus: 601 metrics compared, no digest change, exit 0. Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu Co-authored-by: Claude Opus 5 <[email protected]>
compiler:
\notbefore any relation, as the zero-width\mathrelit is\notwas not in the inventory at all, so$\not=$reported\not is not supported in math mode-- a red error in the Mac app -- andtypeset the five characters
\notliterally, 22.24 pt wide againstpdflatex's zero. Same for
\not<,\not\in,\not\subset.\notis not a symbol of its own.fontmath.ltx432 is\mathchardef\not="3236: class 3 (\mathrel), family 2 (cmsy), slot"36,a glyph whose TFM advance is zero. TeX sets it in an empty box and the
relation that follows draws on top of it. So one
COMMAND_GLYPHSrow plusone
symbol_classrow covers\notbefore any relation, and\ne/\neq/\notinturn out to be the same two atoms already, spelled asone control word.
math.rs:("not", "\u{0338}")inCOMMAND_GLYPHS, and U+0338 added tosymbol_class'sRelarm. The class matters even though the glyph is zerowidth: TeX puts no glue between two Rel atoms, so
\not=comes out exactlyas wide as
=; an Ord\notwould open a 5 mu thick space in front of therelation and
a\not=bwould be 5 mu wide ofa=b.lm_math.rs:('\u{0338}', 0). U+0338 is what Latin Modern Math draws theslash at, and it carries cmsy10's zero advance there too --
tests/lm_math_binding.rsre-reads the pinned font program and confirms it.Without the row the export guard
(
every_math_symbol_has_a_decided_export_outcome) would refuse the newCOMMAND_GLYPHSentry as unrepresentable.crates/compiler/scripts/render_supported_latex.sh(542 -> 543 math-modeentries).
pdflatex TL2025 (pdfTeX 3.141592653-2.6-1.40.27) at 10 pt,
\hbox{$...$},with
\hbox{$ab$}= 9.57755 pt as the atom-class control. Every\notformis exactly as wide as the relation it negates, and spaces as one relation:
$\not=$$\not<$$\not\in$$\not\subset$$=$(control)$\in$(control)Atom class, measured not assumed:
a\not<b,a\not\in b,a\not\subset bsit 13.33322 / 12.22210 / 13.33322 pt over the
abcontrol, which is theglyph's own width plus 2 x 5 mu -- Rel on both sides, residual 0.00015 pt.
The
\not is not supported in math modeerror is gone.New
not_is_a_zero_width_relation_the_following_relation_overprintspinsboth halves through this crate's own layout:
\not=/\not</\not\in/\not\subsetequal to=/</\in/\subset,a\not=bequal toa=b,a\not\in bequal toa\in b, and the slash and the relation both at x 0.It deliberately does not compare
a\neq b: this crate's own v1 layoutsets
\neqas the single precomposed U+2260 glyph (778 units), 0.27 ptnarrower than
=at 18 pt. That is a property of the v1 layout only -- therender pipeline decomposes U+2260 back into the two atoms and measures
$a \neq b$at pdflatex's 22.91077 pt exactly.This does not reach the CLI or the Mac app on its own. Both link
crates/render-pipeline/vendor/compiler, a frozen mirror, sovendor/compilermust be re-pinned past this commit before\notrenders --no vendor file is touched here, and that re-pin belongs to the vendoring
owner. The pipeline half (a
symbol_atomsarm turning a bare U+0338 into oneRel atom, so math-layout's
default_classdoes not make the combiningcharacter Ord) is the sibling render-pipeline PR, which also fixes where the
slash is painted -- that was the actual owner-visible
\ne/\neqdefect.End-to-end verification of all three pieces used a throwaway local copy of
these two files into
vendor/compiler, reverted and never committed; thenumbers above are from that run.
Gates, NixOS linux-primary, bundled
apps/mac/Fonts,FLASHTEX_TFM_DIRS=public/lm:jknappen/ec:public/amsfonts/symbols,CARGO_BUILD_JOBS=4. Zerofont-FAILURE diagnostics (
font_unavailable,required_metrics_unavailable,ec_metrics_unavailable,font_outline_substituted,tfm_missing,math_font_unavailable):32-braces-narrow)The corpus ran
--no-oracle --no-pixels: this machine has neither MacTeX nora rasteriser, so that comparison is status/pages/diagnostics, not pixels.
Implementation-Agent: Claude Opus 5 (engine lane, linux-primary / NixOS)
Commit-Executor: Claude Opus 5 via Claude Code (direct-agent Git execution
under the observed-Cursor-limit user override)
Co-Authored-By: Claude Opus 5 [email protected]
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu