Repository navigation
compiler: math primes as ^\prime, upright \mathrm, distinct \epsilon/\varepsilon - #174
Merged
Merged
Conversation
…\varepsilon
- A math `'` is latex.ltx's `\active@math@prime`: every following `'`
adds another \prime (U+2032) and a directly following `^{...}` joins the
same superscript (`f''`, `g'^2`). It was an apostrophe glyph at text size.
- `\mathrm{...}` with a plain argument is upright `Text` (fontmath.ltx
`operators`), not the italic letters of the surrounding math.
- `\epsilon` is the lunate U+03F5 (cmmi "0F) and `\varepsilon` the open
U+03B5 (cmmi "22), so TFM layouts box each from its own slot. The base-14
Symbol route draws both with the open glyph (export map and v1 shaping).
- Unit test `primes_mathrm_and_epsilons_follow_latex`; supported-LaTeX docs
regenerated.
Implementation-Agent: Claude Opus 5 (subagent kabir-claude math font metrics, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
This was referenced Sep 14, 2026
GoKubar
pushed a commit
that referenced
this pull request
Sep 15, 2026
…prime (#278) (#528) What changed: - The prime's box geometry already matched pdflatex (compiler #174 and math-layout #172): script size, sup shift, one superscript for f'', f'^2 joining it, f_1'/x'_a sub+sup. What was wrong was the painted glyph. The pipeline drew cmsy "30 with Latin Modern Math's cmap glyph for U+2032 (`minute`, ink 430..748/1000 em). That glyph is pre-raised for unscripted Unicode use, so at the superscript position it sat 2.7-3.1bp too high at the bottom and 1.3-1.5bp at the top. - mathfont.rs reads the face's GSUB `ssty` lookups (AlternateSubst, plus Single and Extension). mathtex.rs paints cmsy "30 with the first ssty alternate, `minute.st` (ink 96..549, cmsy's unraised design; lmsy7 is 41..559). - tests/math_primes.rs pins the pdflatex \showbox oracle (10pt and 12pt, inline and display, f'(x) f'' f''' f^{\prime} f'^2 f_1' x'_a) for placement, and lmsy7/lmsy8 AFM ink for the prime, at 0.5bp. What was run: - cargo test --test math_primes (before fix): test result: FAILED. 1 passed; 1 failed - cargo test --test math_primes (after): test result: ok. 2 passed; 0 failed - render-pipeline full suite: every failure (letter_class_geometry 5, uline 2, underline_sout 4, xcolor_oracle 1) panics at src/adapter.rs:1261, the par-leading debug_assert that open PR #517 fixes; no other failures - math-layout and compiler: see PR Next step: re-check the Mac app rendering of f'(x) once this lands. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
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.
Compiler half of the math font metric fixes. It goes with #172 (math-layout). Base
main. No new public types.Changes
'is now latex.ltx's\active@math@prime(15683-15697). Each following'adds another\prime(U+2032), and a directly following^{...}joins the same superscript (f'',g'^2). Before,'was a literal apostrophe glyph at text size.\mathrm. With a plain argument it is uprightNucleus::Text(fontmath.ltxoperators). Before, the group was flattened into italic letters. Spaces in the argument are dropped, as math does.\epsilon/\varepsilon.\epsilonis the lunate U+03F5 (cmmi "0F) and\varepsilonthe open U+03B5 (cmmi "22). Before, both were U+03B5, so HW2 set\varepsilon0.64pt too narrow (reported from render-pipeline: HW1/HW2 residual glyph offsets vs pdflatex #171). The base-14 Symbol route has no lunate glyph and draws both with the open one, in bothexport::map_charand v1 shaping, so no new warning appears.Tests
cargo test --release(compiler): all green.primes_mathrm_and_epsilons_follow_latex.Pipeline
\mathrmtoNucleus::TextChar, soK^{-1}places its script like pdfTeX.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu