Skip to content

compiler: \not before any relation, as the zero-width \mathrel it is - #296

Merged
GoKubar merged 1 commit into
mainfrom
agent/linux-not-slash/compiler-not
Sep 15, 2026
Merged

GoKubar merged 1 commit into
mainfrom
agent/linux-not-slash/compiler-not

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

compiler: \not before any relation, as the zero-width \mathrel it is

\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

`\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
@GoKubar
GoKubar force-pushed the agent/linux-not-slash/compiler-not branch from d9ba437 to 73d33e5 Compare September 15, 2026 22:13
@GoKubar
GoKubar marked this pull request as ready for review September 15, 2026 22:14
@GoKubar

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (2d1b5176) and re-verified on linux-primary.

Conflicts were stale-only, both in generated output. lm_math.rs conflicted solely on the ADVANCES.len() count assert — main had grown the table 80 → 84, so the resolution keeps this branch's ('\u{0338}', 0) row and sets the count to 85. docs/user/compiler.md conflicted because this branch carried a ~15-commit-stale copy of a generated file (it was missing \ominus, \oslash, \odot, \bigcirc, \Box and still had the old \langle 〈). Resolution: take main's copy and re-run crates/compiler/scripts/render_supported_latex.sh, which also refreshed apps/mac/Sources/FlashTeXMac/Resources/supported-latex.json (the branch had left that bundled copy unsynced).

Gates on the rebased tree: compiler suite 493 passed, 0 failed, including tests/supported_latex.rs — so the regenerated artefacts are drift-clean, and \not is present in both the JSON inventory ({"name": "not", "mode": "math", "origin": "math_symbol", "glyph": "̸"}) and the rendered docs table.

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 \ne → /= defect. I confirmed end-to-end against a build carrying both commits — $\not=$ still reports \not is not supported in math mode, exactly as this body predicts, because flashtex-render links the frozen crates/render-pipeline/vendor/compiler mirror rather than crates/compiler. So:

  • render: paint the \not slash across the relation, not in the space before it #295 fixes the owner-visible \ne/\neq bug on its own and should merge without waiting on anything here.
  • This PR adds \not as a first-class relation — a real and separate bug ($\not=$, $\not<$, $\not\subset$ all error and typeset literally today) — but stays inert for the Mac app and CLI until the vendor re-pin lands. That's a follow-up, not a blocker on merging this.

Merging both now so the re-pin picks them up together.

@GoKubar
GoKubar merged commit 2890090 into main Sep 15, 2026
40 of 43 checks passed
GoKubar added a commit that referenced this pull request Sep 15, 2026
GoKubar added a commit that referenced this pull request Sep 15, 2026
GoKubar added a commit that referenced this pull request Sep 15, 2026
GoKubar added a commit that referenced this pull request Sep 15, 2026
…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]>
@GoKubar
GoKubar deleted the agent/linux-not-slash/compiler-not branch September 16, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant