Page MenuHomePhabricator

Space too wide between two \prime symbols (client MathJax)
Closed, ResolvedPublicBUG REPORT

Description

I am using Ubuntu 24.04 with Chrome, Mediawiki 1.46.0-wmf.21 (rMWcc5dd62c0a54) 19:41, 1. Apr. 2026 and MathJax is used as default rendering engine for math environment.

If you use f^{\prime\prime} instead of f'', the space between the two prime symbols is too wide when using MathJax rendering.

image.png (1,367×166 px, 36 KB)

Details

Event Timeline

@Christian1985, is there any difference between \prime and '? If not, we could convert \prime to ' in the checking phase.

Krinkle renamed this task from MathJax Rendering - Space between two prime symbols is too wide to Space too wide between two \prime symbols (client MathJax).Aug 25 2026, 9:37 PM
Krinkle updated the task description. (Show Details)
Krinkle updated the task description. (Show Details)

I am a bit worried that if we change \prime to ' we'll get problems elsewhere...

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

[mediawiki/extensions/Math@master] Normalize explicit prime superscripts

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

I am a bit worried that if we change \prime to ' we'll get problems elsewhere...

It looks like the hidden MathML output from Mathoid/MathJax v2 today does change it this way. But maybe only in some cases?

In the proposed change, we only handle the specific cases as exceptions. I tried to look up the LaTeX source

https://github.com/latex3/latex2e/blob/cf95df5b80349c35628d021bf35418f5d844f2e5/base/ltmath.dtx#L665-L705

and there does not seem to be a conceptual idea behind using ' as an alias for ^{\prime} to get around a certain edge case.

I mean, conceptually, the proposed change makes it worse, but if we want to use the utf-8 symbols for '' and ''', we need this kind of replacement. Otherwise, need to rebuild the whole handling of ' entirely and use individual symbols with less space.

Change #1330302 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Normalize explicit prime superscripts

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

Is this related to the strange client-side SVG issue where two completely different types of prime symbols are used in: C'^{*\!}, C'?

The rendering is:

Screenshot 2026-09-16 at 9.37.31 AM.png (126×68 px, 6 KB)

This is broken. The two prime symbols should both look like the one on the right.