`\blacksquare` (and other AMS geometric symbols) with the Gyre Pagella CHTML font they get inline `font-style: italic` and are slanted by the browser
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.9k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Summary
\blacksquare (U+25FC), \square/\Box (U+25FB), \lozenge/\Diamond (U+25CA), \blacklozenge, \blacktriangle, \bigstar, \checkmark, \maltese, and ~25 more AMS "miscellaneous symbol" macros are registered in the TeX input's AMSsymbols-mathchar0mi character map. mathchar0mi creates an <mi> token whose default mathvariant is italic. The CHTML (and SVG) output therefore renders these geometric symbols with italic styling:
- with the Gyre-Pagella dynamic CHTML font, the glyph node carries the inline style
font-family: MJX-GP-ZERO, serif; font-style: italic;, and the browser synthesizes an oblique slant for U+25FC — the black square is visibly tilted; - the serialized MathML is semantically wrong too:
<mi>◼</mi>(italic identifier) instead of an upright ordinary symbol.
In LaTeX (amssymb), \blacksquare is \DeclareMathSymbol{\blacksquare}{\mathord}{AMSa}{"04} — a mathord, upright.
Environment
- MathJax 4.1.3
- TeX input (
input/tex),amspackage enabled - CHTML output, Gyre-Pagella font (
@mathjax/mathjax-pagella-font), dynamic font mode
Minimal reproduction
Observed
CHTML wraps the glyph in an italic identifier element:
<mjx-container ...><mjx-math ...><mjx-mi data-latex="\blacksquare"><mjx-c class="mjx-c25FC">◼</mjx-c></mjx-mi></mjx-math></mjx-container>
MathML:
<mi data-latex="\blacksquare">◼</mi>
With the Gyre-Pagella font (dynamic CHTML mode), the glyph node's inline style is:
font-family: MJX-GP-ZERO, serif; font-style: italic;
and the rendered \blacksquare is visibly slanted (browser-synthesized oblique), exactly like an italic math identifier. Compare with the base-package symbol \triangle, which renders <mi mathvariant="normal">△</mi> (upright).
Expected
\blacksquarerenders upright — nofont-style: italic, no synthetic slant.- The serialized MathML should be an upright ordinary symbol (e.g.
<mi mathvariant="normal">or anmowith no operator spacing), matching LaTeX's\mathordclass.
Coverage
Scanned eleven v4 font packages (@mathjax/mathjax-*-font@4.1.3), every variant file. "✓" = the codepoint exists in at least one variant (usually the normal variant, from which italic inherits via the prototype chain — the glyph then comes from the math font and is upright); "✗" = absent from the entire package → CHTML falls back to font-style: italic; font-family: <prefix>-ZERO, serif → browser-synthesized slant.
The eleven fonts collapse into four identical-coverage groups:
- A — TeX / new-cm (default) / modern / STIX2: best coverage, only the universal 4 missing.
- B — Asana: adds
\diagup,\diagdown. - C — Fira: misses the geometric set plus
\checkmark,\maltese. - D — Pagella / Bonum / DejaVu / Schola / Termes (Gyre family + DejaVu): misses the geometric set plus
\blacktriangle,\blacktriangledown.
| command | U+ | A: TeX / new-cm / modern / STIX2 | B: Asana | C: Fira | D: Pagella / Bonum / DejaVu / Schola / Termes |
|---|---|---|---|---|---|
\blacksquare |
25FC | ✓ | ✓ | ✗ | ✗ |
\square/\Box |
25FB | ✓ | ✓ | ✗ | ✗ |
\lozenge/\Diamond |
25CA | ✓ | ✓ | ✓ | ✓ |
\blacklozenge |
29EB | ✓ | ✓ | ✗ | ✗ |
\blacktriangle |
25B4 | ✓ | ✓ | ✓ | ✗ |
\blacktriangledown |
25BE | ✓ | ✓ | ✓ | ✗ |
\bigstar |
2605 | ✓ | ✓ | ✗ | ✗ |
\checkmark |
2713 | ✓ | ✓ | ✗ | ✓ |
\maltese |
2720 | ✓ | ✓ | ✗ | ✓ |
\hslash |
210F | ✓ | ✓ | ✓ | ✓ |
\sphericalangle |
2222 | ✓ | ✓ | ✓ | ✓ |
\measuredangle |
2221 | ✓ | ✓ | ✓ | ✓ |
\nexists |
2204 | ✓ | ✓ | ✓ | ✓ |
\complement |
2201 | ✓ | ✓ | ✓ | ✓ |
\mho |
2127 | ✓ | ✓ | ✓ | ✓ |
\Finv |
2132 | ✓ | ✓ | ✗ | ✗ |
\Game |
2141 | ✓ | ✓ | ✗ | ✗ |
\diagup |
2571 | ✓ | ✗ | ✗ | ✗ |
\diagdown |
2572 | ✓ | ✗ | ✗ | ✗ |
\yen |
00A5 | ✗ | ✗ | ✗ | ✗ |
\circledR |
00AE | ✗ | ✗ | ✗ | ✗ |
\beth/\gimel/\daleth (letter-like) |
2136–38 | ✓ | ✓ | ✓ | ✓ |
\digamma, \varkappa (letter-like) |
03DD/03F0 | ✗ | ✗ | ✗ | ✗ |
Missing counts per group (of the 26 affected entries): A = 4 (\yen, \circledR, \digamma, \varkappa) · B = 6 · C = 14 · D = 14.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TeX input's AMSsymbols-mathchar0mi character map and compare the affected macros with the base-package \triangle registration. Use browser-repro.html to inspect the generated CHTML and serialized MathML for the affected symbols across the listed font packages. Done means the symbols are registered as upright ordinary symbols and no longer receive synthetic italic styling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100