Skip to content

compiler: \coloneqq is \vcentcolon\mkern-1.2mu= under mathtools (#468; needs render-pipeline re-pin) - #529

Merged
GoKubar merged 1 commit into
mainfrom
agent/daniel-parent/coloneqq-compose
Sep 15, 2026
Merged

GoKubar merged 1 commit into
mainfrom
agent/daniel-parent/coloneqq-compose

Conversation

@d-q222

@d-q222 d-q222 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What

With \usepackage{mathtools} loaded, \coloneqq now parses the way mathtools defines it, as \vcentcolon\mathrel{\mkern-1.2mu}= (\MATHT@coloneq, mathtools.sty lines 487/506/531). It becomes one Rel group, [vcentcolon_atom, mkern(-1.2), "="], the same shape as the existing \eqqcolon/\Coloneqq arms from #472. Its colon is therefore raised onto the math axis by the existing vcentcolon_raise layout path.

Without mathtools, \coloneqq keeps the precomposed U+2254 ≔ glyph from command_glyph, as before. Base LaTeX has no \coloneqq, so nothing there changes. This includes the amssymb Latin Modern Math binding test.

This is a compiler-only change. crates/render-pipeline/vendor/compiler must be re-pinned past this commit before the rendered pipeline sees it. The pipeline PR for #468 carries an ignored test, coloneqq_decomposes_like_mathtools, for that re-pin to un-ignore.

Why

Review of the #468 pipeline lane found that \coloneqq was still one baseline ≔ glyph under mathtools. pdfLaTeX, measured locally with /Library/TeX/texbin/pdflatex (12pt, lmodern, mathtools), draws two glyphs. Positions are glyph origins relative to a, read with PyMuPDF get_text("rawdict"):

$a\coloneqq b$ pdflatex compiler before compiler after
glyphs a : = b a ≔ b a : = b
: x / dy 9.466bp / -0.415bp n/a raised by vcentcolon_raise
= x 11.921bp n/a colon + (-1.2mu)
b x 24.3544bp n/a
\sbox width 29.43333pt (same as \eqqcolon) colon + equals - 1.2mu + 2 thick spaces

Cross-check: I copied the #468 pipeline branch to a scratch directory and replaced only its vendor/compiler/src/math.rs with this commit's file. The repo's vendor/ was not touched. In that copy the pipeline renders : x=9.4658 dy=-0.4151, = x=11.9206, b x=24.3463, matching pdflatex within 0.01bp.

Overlap check

Test results

With CARGO_TARGET_DIR=target-coloneqq:

  • cargo test --lib colon: test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 334 filtered out
  • Mutation (the new arm guarded off): test result: FAILED. 2 passed; 3 failed
  • Full cargo test --manifest-path crates/compiler/Cargo.toml --no-fail-fast: 57 test targets, 669 passed / 0 failed / 5 ignored; lib line test result: ok. 339 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Not done

  • mathtools' other colon relations are still unsupported by the compiler: \coloneq, \Coloneq, \eqcolon, \Eqcolon, \colonapprox, \colonsim, etc. With default options, \coloneq/\Coloneq alias \coloneqq/\Coloneqq and \eqcolon/\Eqcolon alias \eqqcolon/\Eqqcolon. \colonapprox/\colonsim are \vcentcolon\mathrel{\mkern-1.2mu}\approx/\sim. The pdflatex widths are measured (29.43333pt; 29.62769pt for approx/sim) if someone picks them up.
  • No vendor re-pin (integration lane).

🤖 Generated with Claude Code

https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

What changed:
- math.rs: with mathtools loaded, `\coloneqq` parses to one Rel group
  `[vcentcolon_atom, mkern(-1.2), "="]` (mathtools.sty `\MATHT@coloneq`,
  lines 487/506/531), so its colon is raised onto the math axis like the
  rest of the family. Without mathtools the precomposed U+2254 glyph stays
  (base LaTeX has no `\coloneqq`; behaviour there is unchanged).
- Tests: `\coloneqq` joins the width, axis-centring and parse tests; a new
  assertion keeps U+2254 for KERNEL and AMSSYMB packages.

pdfLaTeX oracle (12pt lmodern mathtools, `$a\coloneqq b$`, glyph origins
relative to `a`): `:` x=9.466bp dy=-0.415bp, `=` x=11.921bp, `b`
x=24.3544bp, box width 29.43333pt (same as `\eqqcolon`).

What was run:
- cargo test --lib colon (CARGO_TARGET_DIR=target-coloneqq):
  test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 334 filtered out
- Mutation (arm guarded off): 3 of those 5 FAILED.

Next step: re-pin crates/render-pipeline/vendor/compiler past this commit
and un-ignore render-pipeline's `coloneqq_decomposes_like_mathtools`.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
d-q222 added a commit that referenced this pull request Sep 15, 2026
…q test waits for #529

What changed:
- math_symbols.rs: the `\coloneqq` assertion that accepted the precomposed
  baseline U+2254 as correct is gone. `coloneqq_decomposes_like_mathtools`
  pins pdflatex's values instead (`:` x=9.466 dy=-0.415, `=` x=11.921,
  `b` x=24.3544 bp) and is `#[ignore = "needs re-pin past #529"]`.
- New `mathtools_composed_colons_match_pdflatex`: `\vcentcolon`,
  `\dblcolon`, `\Coloneqq`, `\eqqcolon`, `\Eqqcolon` glyph x (0.02bp) and
  dy (0.01bp) against pdflatex 12pt lmodern mathtools.
- New `unraised_colons_match_pdflatex`: literal `:`, `\mathrel{:}` (a
  `Nucleus::Group`) and `\colon` stay on the baseline, under mathtools.
- Oracle comment now gives the .tex source and the PyMuPDF rawdict
  measurement; the unused font_id/gid/font_size probe fields are dropped.

What was run (FLASHTEX_FONT_DIRS/TFM_DIRS=apps/mac/Fonts,
CARGO_TARGET_DIR=target-vcent):
- --test math_symbols: test result: ok. 15 passed; 0 failed; 1 ignored
- Mutation (vcentcolon detection off): mathtools_composed_colons_match_pdflatex
  and ..._without_spacing_changes FAILED ("vcentcolon glyph 1 `:`: dy=0.0000bp,
  pdflatex -0.415").
- Scratch copy with only vendor/compiler/src/math.rs swapped for #529's
  (repo vendor untouched): coloneqq_decomposes_like_mathtools ... ok.
- amsmath corpus: TOTAL 59/59 within 0.5 bp
- --lib: test result: ok. 137 passed; 0 failed; 2 ignored
- math-layout: all targets ok (12+4+5+28+4+2+11 passed, 0 failed)

Next step: open the pipeline PR; un-ignore the \coloneqq test at the re-pin
past #529.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
@GoKubar
GoKubar merged commit a95e4a0 into main Sep 15, 2026
21 checks passed
GoKubar pushed a commit that referenced this pull request Sep 15, 2026
…468) (#530)

* render-pipeline: center forced mathtools colons

What changed:
Carry the compiler's exact forced-Rel colon marker through math conversion as an outer Rel atom containing math-layout's existing Op axis-centering path. The Op path uses the real glyph bounds and axis_height; vendor files remain untouched.

What was run:
cargo check --manifest-path crates/render-pipeline/Cargo.toml --lib: passed
git diff --check: passed

Next step:
Add the pdflatex oracle and horizontal-spacing regression coverage.

Implementation-Agent: codex gpt-5.6-luna (max)
Commit-Executor: codex (this session)
Lane-Owner: daniel-parent (mac-m5pro-dq222)

* render-pipeline: pin mathtools colon oracle

What changed:
Add the pdflatex vertical-position probe and pin current-main horizontal advances for vcentcolon, coloneqq, dblcolon, and literal colon. Cover kernel and amsmath colon controls and verify the existing precomposed coloneqq glyph remains axis-balanced.

What was run:
cargo test --manifest-path crates/render-pipeline/Cargo.toml --test math_symbols mathtools_colons_match_pdflatex_vertical_oracle_without_spacing_changes: 1 passed
cargo test --manifest-path crates/render-pipeline/Cargo.toml --test math_symbols --test math_operator_limits --test math_ellipsis --test math_spacers --test math_text_italic_correction --test amsmath_inline: 43 passed

git diff --check: passed

Next step:
Run the full required gates, review the commits, and push the branch.

Implementation-Agent: codex gpt-5.6-luna (max)
Commit-Executor: codex (this session)
Lane-Owner: daniel-parent (mac-m5pro-dq222)

* render-pipeline: pdflatex oracle for the whole colon family; \coloneqq test waits for #529

What changed:
- math_symbols.rs: the `\coloneqq` assertion that accepted the precomposed
  baseline U+2254 as correct is gone. `coloneqq_decomposes_like_mathtools`
  pins pdflatex's values instead (`:` x=9.466 dy=-0.415, `=` x=11.921,
  `b` x=24.3544 bp) and is `#[ignore = "needs re-pin past #529"]`.
- New `mathtools_composed_colons_match_pdflatex`: `\vcentcolon`,
  `\dblcolon`, `\Coloneqq`, `\eqqcolon`, `\Eqqcolon` glyph x (0.02bp) and
  dy (0.01bp) against pdflatex 12pt lmodern mathtools.
- New `unraised_colons_match_pdflatex`: literal `:`, `\mathrel{:}` (a
  `Nucleus::Group`) and `\colon` stay on the baseline, under mathtools.
- Oracle comment now gives the .tex source and the PyMuPDF rawdict
  measurement; the unused font_id/gid/font_size probe fields are dropped.

What was run (FLASHTEX_FONT_DIRS/TFM_DIRS=apps/mac/Fonts,
CARGO_TARGET_DIR=target-vcent):
- --test math_symbols: test result: ok. 15 passed; 0 failed; 1 ignored
- Mutation (vcentcolon detection off): mathtools_composed_colons_match_pdflatex
  and ..._without_spacing_changes FAILED ("vcentcolon glyph 1 `:`: dy=0.0000bp,
  pdflatex -0.415").
- Scratch copy with only vendor/compiler/src/math.rs swapped for #529's
  (repo vendor untouched): coloneqq_decomposes_like_mathtools ... ok.
- amsmath corpus: TOTAL 59/59 within 0.5 bp
- --lib: test result: ok. 137 passed; 0 failed; 2 ignored
- math-layout: all targets ok (12+4+5+28+4+2+11 passed, 0 failed)

Next step: open the pipeline PR; un-ignore the \coloneqq test at the re-pin
past #529.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
@GoKubar
GoKubar deleted the agent/daniel-parent/coloneqq-compose branch September 16, 2026 04:17
ItsAkilesh pushed a commit to ItsAkilesh/flashtex that referenced this pull request Sep 18, 2026
…tex#769)

Split out from PR flash-tex#247 (closed as superseded); the fix itself never landed
when flash-tex#247 was superseded by flash-tex#230/flash-tex#529/flash-tex#530. main still carried \mod as an
unconditional plain text atom, with a comment saying the gap was
deliberate.

- \mod is undefined in base LaTeX2e (amsmath.sty 910-911); gated the same
  way \sideset already is: `"mod" if !self.packages.amsmath =>
  self.missing_package(...)`.
- Under amsmath, \mod opens with \mkern12mu (inline; this compiler has no
  display flag, so the inline number is the one that applies, matching how
  \pmod already handles the same distinction), sets its argument as an
  ordinary (not Bin) upright "mod" via required_group + class_override,
  and puts 6mu before the argument. Two new constants,
  AMSMATH_MOD_OPENING_MU and AMSMATH_MOD_TRAILING_MU, mirror the existing
  AMSMATH_POD_MU/BMOD_EXTRA_MU pattern.

Verified against TeX Live 2025 pdflatex at 10pt (see the code comment for
the measured equivalences); added mod_needs_amsmath (mirrors
sideset_needs_amsmath) and a width test mirroring the existing pmod/bmod
style. cargo test --lib: 414 passed, 0 failed.

Commit-Executor: daniel-muse-lead (Claude Sonnet)
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.

2 participants