Skip to content

render-pipeline: mathtools' \vcentcolon family sits on the math axis (#468) - #530

Merged
GoKubar merged 3 commits into
mainfrom
agent/daniel-parent/vcentcolon-pipeline
Sep 15, 2026
Merged

GoKubar merged 3 commits into
mainfrom
agent/daniel-parent/vcentcolon-pipeline

Conversation

@d-q222

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

Copy link
Copy Markdown
Contributor

What

The rendered pipeline now centres mathtools' \vcentcolon colon on the math axis, as in pdfLaTeX (\vcentcolon is \mathrel{\mathop\ordinarycolon}). The same applies to every relation the compiler builds from it: \dblcolon, \Coloneqq, \eqqcolon and \Eqqcolon.

  • typeset::convert_math_classed: a Symbol(":") carrying the compiler's forced Rel class, exactly what vcentcolon_atom produces, keeps its Rel outer atom for spacing. Its nucleus becomes a one-atom Op list, so math-layout's existing real-glyph-bounds axis centring places it. No new offsets are hard-coded, and math-layout itself is unchanged.
  • These stay on the baseline: a literal :, \mathrel{:} (a Nucleus::Group, not a forced-Rel Symbol), kernel \colon (Punct) and amsmath \colon (Ord).
  • Tests (tests/math_symbols.rs): a pdfLaTeX glyph-position oracle for the whole family plus the negative controls, and a horizontal no-change control against main.

\coloneqq needs a compiler change first: #529. The pinned compiler still maps \coloneqq to the precomposed U+2254 ≔ even under mathtools, so the pipeline never sees a colon atom. #529 decomposes it as mathtools does, \vcentcolon\mathrel{\mkern-1.2mu}=. Here coloneqq_decomposes_like_mathtools pins pdfLaTeX's values under #[ignore = "needs re-pin past #529"], and nothing asserts the ≔ behaviour as correct.

Why

Issue #468. #472 centred these colons in the compiler's own layout, and #477 re-pinned it here. The pipeline, however, laid them out as ordinary baseline relations.

Oracle

/Library/TeX/texbin/pdflatex, TeX Live 2026, 12pt article, lmodern, mathtools. Glyph origins were read from the PDF with PyMuPDF get_text("rawdict"). x is relative to a; dy is relative to a's baseline, negative = raised. All values are in bp.

formula glyph pdflatex x / dy before (main) x / dy after x / dy
a\vcentcolon b : 9.466 / -0.415 9.4658 / 0.0000 9.4658 / -0.4151
b 16.039 / 0 16.0384 / 0 16.0384 / 0
a\dblcolon b : : 9.466, 12.120 / -0.416 9.4658, 12.1198 / 0.0000 9.4658, 12.1198 / -0.4151
a\Coloneqq b : : = b 9.466, 12.120 (-0.415), 14.575, 27.0084 same x, dy 0 9.4658, 12.1198 (-0.4151), 14.5746, 27.0003
a\eqqcolon b = : b 9.4685, 17.774 (-0.415), 24.347 same x, dy 0 9.4658, 17.7736 (-0.4151), 24.3463
a\Eqqcolon b = : : b 9.4685, 17.774, 20.4281 (-0.415), 27.001 same x, dy 0 9.4658, 17.7736, 20.4277 (-0.4151), 27.0003
a\coloneqq b : 9.466 (-0.415), = 11.921, b 24.3544 ≔ 6.1449 (dy 0), b 16.9763 unchanged until #529; with #529's math.rs: 9.4658 (-0.4151), 11.9206, 24.3463
a:b : b 9.4685, 16.0439 / 0 9.4658, 16.0384 / 0 unchanged
a\mathrel{:}b : b 9.4685, 16.0439 / 0 9.4658, 16.0384 / 0 unchanged
a\colon b : b 7.472, 14.7049 / 0 7.4733, 14.7102 / 0 unchanged

\sbox widths: 21.0943pt (\vcentcolon, :, \mathrel{:}), 23.75832pt (\dblcolon), 29.43333pt (\coloneqq, \eqqcolon), 32.09735pt (\Coloneqq, \Eqqcolon) and 19.76099pt (\colon). pdfTeX writes positions to three decimals, so the tests compare x within 0.02bp and dy within 0.01bp. Horizontal advances and positions are unchanged against main to 0.001bp.

The "with #529" row was checked in a scratch copy of this branch. Only vendor/compiler/src/math.rs was replaced there by #529's file; this repository's vendor/ is untouched.

Overlap check

Test results

With FLASHTEX_FONT_DIRS/FLASHTEX_TFM_DIRS=apps/mac/Fonts and CARGO_TARGET_DIR=target-vcent:

  • amsmath oracle corpus (oracle.py check --render target-vcent/release/flashtex-render --fonts apps/mac/Fonts, as in render-pipeline: re-pin vendor/compiler to main (6a47ed49), implement CleverReference, default math-class-override #477): TOTAL 59/59 within 0.5 bp
  • cargo test -p render-pipeline --lib: test result: ok. 137 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out
  • --test math_symbols: test result: ok. 15 passed; 0 failed; 1 ignored (the ignored test is \coloneqq, pending compiler: \coloneqq is \vcentcolon\mkern-1.2mu= under mathtools (#468; needs render-pipeline re-pin) #529)
  • The other render-pipeline math targets are all 0 failed: amsmath_inline 11, amsmath_openup_jot 1, boxed_math 1, display_math 1, inline_math_breaks 2, math_ellipsis 5, math_grids 3, math_operator_limits 6, math_operator_thin_space 3, math_spacers 4, math_text 7, math_text_italic_correction 4, v2_and_math 6.
  • cargo test --manifest-path crates/math-layout/Cargo.toml: every target is ok (lib 12, big_delimiters 4, glue_set 5, golden 28, kernel_symbols 4, size_oracle 2, source_spans 11; 0 failed).
  • Mutation (the detector forced off): mathtools_composed_colons_match_pdflatex and mathtools_colons_match_pdflatex_vertical_oracle_without_spacing_changes FAIL with vcentcolon glyph 1 ':': dy=0.0000bp, pdflatex -0.415.

Not done

🤖 Generated with Claude Code

https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

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)
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)
…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 1bfa108 into main Sep 15, 2026
21 checks passed
@GoKubar
GoKubar deleted the agent/daniel-parent/vcentcolon-pipeline branch September 16, 2026 04:16
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