Page MenuHomePhabricator

Super-superscripts and nested script levels are illegibly small in client-side SVG mode
Closed, InvalidPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Preference setting: MathML with SVG image (client side MathJax rendering)
  • Markup: <math>x ^ {x ^ {568 + xyz + il\ell e c + \rho p} }</math>
  • Second example, potentially the same cause: <math>\sum_0^{\frac12 X }</math>
  • Compare with MathML with SVG image (server side MathJax rendering)

What happens?:

Screenshot 2026-09-28 at 15.43.59.png (1,674×692 px, 69 KB)

What should have happened instead?:
Font-size should be legible and not too small

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • Note that current state is not that good either but client-side MathJax is smaller

Event Timeline

MSantos triaged this task as High priority.Sep 28 2026, 6:57 PM

The fundamental issue (which affects all versions of MathJax) is that there is no change of font for different sizes of symbols, so the same outlines are used irrespective of symbol size. In LaTeX running offline, different sizes of symbols use different outlines, which have had their shapes modified to suit the size. Symbols intended for small size rendering often have thicker strokes, simplified features, larger counters (spaces inside a letter), modified x-height, etc.

In the font(s) used for MathJax version 2, the basic symbol shapes had thick enough strokes that even when shrunk down they could still be seen more or less, though they weren't ideal.

In the font(s) which are now default in MathJax version 4, the symbol shapes have thinner strokes than before. At normal text size, these are still legible enough, but when shrunk to the size for inline fractions, superscripts, and (especially) nested superscripts, they become extremely thin.

In my opinion this is a significant legibility/accessibility issue.

I think this can be addressed by configuring MathJax version 4 to use the same font(s) as MathJax version 2 used.

Physikerwelt subscribed.

I can't see what's wrong. For me, it looks as small as in LaTeX

Screenshot 2026-10-05 at 16.17.02.png (718×146 px, 14 KB)

I could also never differentiate between $x^y^z$ and $x^{yz}$ on the blackboard without the context.

I think this can be addressed by configuring MathJax version 4 to use the same font(s) as MathJax version 2 used.

See https://docs.mathjax.org/en/v4.0/upgrading/whats-new-4.0/fonts.html for the options. This is not a technical problem, but something that could, for example, be discussed on the math community mailing list.

The letters are not smaller overall. The issue is that the strokes are very thin.

In LaTeX, you will notice that different outlines are used for the same symbol depending on the font size. The smaller font has relatively thicker strokes, larger counters, and different proportions (e.g. the relative x-height, ascender height, etc. are different). If you want to see this more directly you can make some of the symbols in various levels of superscript and then use the "\resizebox" command to scale them to the same absolute size:

Screenshot 2026-10-05 at 11.27.05 AM.png (584×416 px, 41 KB)

(From top to bottom, this is double superscript, superscript, and then regular size.)

In all of the MathJax renderers, the same outlines are used for a particular symbol irrespective of font size; the letter is naïvely uniformly scaled up or down. This means that the smaller size fonts end up less legible, because their shapes and weight were designed for the size of body text. Because the font used in MathJax v. 2 has relatively thicker strokes (bolder weight), it is more robust against being shrunk than the font used by default in MathJax v. 4, which is thinner.

@Jacobolus, if it were on me, we would use TeX instead of HTML in the browser :-)
@MSantos, I don't see an action item here. Maybe you want to close this ticket and open a new one about the global font choice.

Or, for completeness, here is the full range of font sizes in LaTeX from \tiny to \Huge, rescaled to the same absolute size:

Screenshot 2026-10-05 at 11.40.42 AM.png (650×842 px, 153 KB)

You can see how as we go from top to bottom the strokes get progressively thinner.

MSantos lowered the priority of this task from High to Medium.Oct 6 2026, 2:18 PM

I'll lower the priority on this one to not make the confidence framework confusing.

I think this is a nontrivial accessibility issue. I'm concerned that some readers will have difficulty reading mathematical expressions if the smallest symbols get too thin.


The basic technical question I have on this is:

Can we successfully configure MathJax v. 4 to use the same font(s) as MathJax v. 2? What would be the ramifications of that?

Or can we assemble our own font(s) for MathJax?

(My understanding is that the different MathJax fonts have different ranges of symbol support, and between versions they made some changes to break up large fonts into multiple pieces so not all of the data needs to be sent to the browser, etc.)

I will file a new issue for global font choice. It’s a bit a dilemma as the new version of the old font type is good for regression testing but bad for non latin characters.