Page MenuHomePhabricator

Not enough space around min and max in native MathML mode
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
DavidEppstein
Mar 17 2025, 11:45 PM
Project Tags
Referenced Files
F72317692: Screenshot 2026-02-24 at 22.26.21.png
Feb 24 2026, 10:27 PM
F72134834: Screenshot 2026-02-16 at 18.05.47.png
Feb 16 2026, 6:07 PM
F72134815: Screenshot 2026-02-16 at 17.58.31.png
Feb 16 2026, 6:07 PM
F72134812: Screenshot 2026-02-16 at 17.58.26.png
Feb 16 2026, 6:07 PM
F65755728: image.png
Aug 15 2025, 11:57 AM
F65755678: image.png
Aug 15 2025, 11:49 AM
F65755625: image.png
Aug 15 2025, 11:43 AM
F58855970: Screenshot 2025-03-17 at 4.44.27 PM.png
Mar 17 2025, 11:45 PM

Description

In a formula with consecutive min and max operators such as the ones in https://en.wikipedia.org/wiki/Minimax_theorem and https://en.wikipedia.org/wiki/Yao%27s_principle, the native MathML rendering (as viewed on Firefox/MacOS) provides no space between these operators (and the subscripted limits under them) and the next operator, so that an expression like min max E ... from the Yao's principle link looks instead like minmaxE (and the subscripted limits are also jammed together in the same way).

Screenshot 2025-03-17 at 4.44.27 PM.png (3,584×2,240 px, 2 MB)

The spacing of these subexpressions looks ok in svg and the experimental client-side MathJax rendering.

<math>\max_{D} \min_{A} \mathbb{E}</math>

image.png (212×186 px, 8 KB)

See https://www.mediawiki.org/wiki/Extension:Math/Native_MathML/Reported_Cases#New_cases_as_of_Aug_2025

Event Timeline

Original example

<math display=block>
\max_{D\in \mathcal{D}} \min_{A\in\mathcal{A}} \mathbb{E}_{x\sim D}[c(A,x)]=\min_{R\in \mathcal{R}} \max_{x\in\mathcal{X}} \mathbb{E}[c(R,x)].
</math>

From https://en.wikipedia.org/w/index.php?title=Yao%27s_principle renders fine.

image.png (319×183 px, 20 KB)

This is due to the length of text below. If you shorten that text space between operators disappears.

A similar problem occurs in T386318 with <math>\sin \cos^2</math>

image.png (231×168 px, 6 KB)

Krinkle updated the task description. (Show Details)

MathJax SVG (status quo): OK

Screenshot 2026-02-16 at 17.58.26.png (262×168 px, 10 KB)

Chrome:

Screenshot 2026-02-16 at 17.58.31.png (398×300 px, 24 KB)

The MathJax MathML seems to render OK, so this suggests it is not a browser bug but something we can fix in MediaWiki. We currently place max/min in <mo> wheras MathJax places both top and bottom in <mi>.

Screenshot 2026-02-16 at 18.05.47.png (843×1,282 px, 122 KB)

Change #1240069 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Use mo tags for min max lim and similar operators

https://gerrit.wikimedia.org/r/1240069

Change #1240069 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Use mo tags for min max lim and similar operators

https://gerrit.wikimedia.org/r/1240069