Skip to content

compiler: \textsc/\scshape/\sc and \mathsf/\mathtt/\mathit/\mathfrak alphabets (companion of #134) - #136

Merged
jay3332 merged 2 commits into
mainfrom
agent/kabir-claude/font-families-compiler
Sep 13, 2026
Merged

jay3332 merged 2 commits into
mainfrom
agent/kabir-claude/font-families-compiler

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Based on main 85ec30c7. Compiler only. Companion of #134 (render-pipeline NFSS families, shapes and math alphabets), but neither PR needs the other to build or pass.

What

1. \textsc{...}, \scshape and the LaTeX 2.09 form \sc are supported style commands.

2. Math alphabets.

  • A plain argument (words and spaces only) of \mathsf, \mathtt or \mathit, and every \mathfrak argument, becomes one Symbol atom of Unicode mathematical alphanumerics, like \mathbb/\mathcal:
    • sans-serif U+1D5A0 (digits U+1D7E2);
    • monospace U+1D670 (digits U+1D7F6);
    • italic U+1D434 (h is U+210E);
    • fraktur U+1D504, with the Letterlike exceptions C, H, I, R, Z.
  • Characters without a code point (italic/fraktur digits, punctuation) are unchanged. Any other argument, such as \mathsf{x^2}, keeps today's behaviour: the surrounding math letters.
  • Before: \mathsf/\mathtt/\mathit were set in the default math letters, and \mathfrak was an error.
  • \mathfrak leaves the unimplemented vocabulary. tests/diagnostic_codes.rs now uses \mathscr as its unsupported example.
  • The render pipeline (render-pipeline: NFSS font families, shapes and math alphabets (sans, typewriter, small caps, slanted, \mathsf/\mathfrak) #134) sets them in the fonts LaTeX uses:
    • fontmath.ltx: OT1 cmss/cmtt/cmr-it, i.e. rm-lmss/rm-lmtt/rm-lmri metrics;
    • amsfonts.sty/ueuf.fd: eufm5/7/10.

No change to any public type, so no pipeline match or literal breaks on a re-pin. Before #134, a re-pinned pipeline would draw these code points from Latin Modern Math with OpenType advances.

Verification

  • New tests: small_caps_commands_are_supported_and_scoped (parser) and math_alphabets_map_plain_letters_to_unicode_alphanumerics (math). Existing unbraced_style_switches_match_their_braced_form still passes.
  • crates/compiler/scripts/render_supported_latex.sh regenerated docs/user/compiler.md, supported/supported-latex.json and supported/coverage.md.
  • cargo test --release in crates/compiler: all test binaries green, including supported_latex, unsupported_inventory and diagnostic_codes.

Integrator notes

  • apps/mac's bundled copy of supported-latex.json is not touched here, because apps/ is outside this lane.
  • The compiler's own base-14 export has no glyphs for the alphanumeric code points and reports them unrepresentable, as it already does for \mathbb/\mathcal.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

GoKubar and others added 2 commits September 13, 2026 07:38
They were reported as unsupported commands although the text was set.
The Core 14 layout has no small-caps faces, so they keep the current
style (\sc resets like the other LaTeX 2.09 forms); the render pipeline
selects the NFSS sc shape itself. Supported inventory regenerated.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude font families, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
…alphanumerics

A plain argument of \mathsf/\mathtt/\mathit (and every \mathfrak
argument) becomes one Symbol atom of Unicode mathematical sans-serif,
monospace, italic or fraktur code points, like \mathbb; any other
argument keeps the surrounding math letters. The render pipeline maps
them to the fontmath.ltx/amsfonts.sty fonts (cmss, cmtt, cmti, eufm).
\mathfrak leaves the unimplemented vocabulary; inventory regenerated.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude font families, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
@GoKubar GoKubar changed the title compiler: support \textsc, \scshape and \sc (companion of #134) compiler: \textsc/\scshape/\sc and \mathsf/\mathtt/\mathit/\mathfrak alphabets (companion of #134) Sep 13, 2026
GoKubar added a commit that referenced this pull request Sep 13, 2026
…d \mathfrak

The compiler's Unicode mathematical alphanumerics (companion PR #136) and
\mathbf are set in the fonts fontmath.ltx/amsfonts.sty use: runs of a text
alphabet through the math text sink in that NFSS shape (TFM kerns and
ligatures, last italic correction as delta), a single character as a math
character from its TFM (TeX 1186), fraktur from eufm5/7/10 boxes with Latin
Modern Math's Euler outlines. eufm TFM directory added to discovery.

Oracle fixtures 47-50: \mathbf passes on main's vendor (0.15 bp); the
alphabet fixtures are PENDING on the #136 re-pin and match pdflatex within
0.39 bp in a scratch build with #136 vendored. HW1/HW2 byte-identical.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude font families, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
@jay3332
jay3332 merged commit 57b7c67 into main Sep 13, 2026
11 of 18 checks passed
@jay3332

jay3332 commented Sep 13, 2026

Copy link
Copy Markdown
Member

Merged to main via integration/2026-09-13k (Commander).

@GoKubar
GoKubar deleted the agent/kabir-claude/font-families-compiler branch September 13, 2026 18:12
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