Page MenuHomePhabricator

Client-side MathJax rendering problems
Open, MediumPublicBUG REPORT

Assigned To
Authored By
SalixAlba
Sep 19 2024, 9:19 PM
Referenced Files
Restricted File
Feb 21 2026, 10:12 AM
F72208677: image.png
Feb 20 2026, 4:55 PM
F71791369: Screenshot 2026-02-10 at 12.21.39.png
Feb 10 2026, 11:22 AM
F71791335: Screenshot 2026-02-10 at 12.20.14.png
Feb 10 2026, 11:22 AM
F71791292: Screenshot 2026-02-10 at 12.18.05.png
Feb 10 2026, 11:22 AM
F69815620: Screenshot From 2025-11-03 19-02-02.png
Nov 3 2025, 6:02 PM
F69377483: Screenshot 2025-11-02 at 05.44.08.png
Nov 2 2025, 4:44 AM
F66755238: image.png
Oct 16 2025, 8:08 PM

Description

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

What happens?:

The following latex expressions fail.

  • <math>\tilde{a}</math> gives "mover" red writing on yellow background
  • <math>^\wedge</math> gives " msup" red writing on yellow background
  • <math>f(n) =\begin{cases} n/2, & \text{if }n\text{ is even} \\3n+1, & \text{if }n\text{ is odd}\end{cases}</math> "math input error"
  • <math>\boldsymbol{\alpha \beta \gamma \delta \epsilon \zeta \eta \theta}</math> "math output error"
  • <math> \boldsymbol{\iota \kappa \lambda \mu \nu \xi \omicron \pi}</math> "math output error"
  • <math> \boldsymbol{\rho \sigma \tau \upsilon \phi \chi \psi \omega}</math> "math output error"
  • <math> \boldsymbol{\varepsilon\digamma\varkappa\varpi}</math> "math output error"
  • <math> \boldsymbol{\varrho\varsigma\vartheta\varphi}</math> "math output error"
  • <math> \text{if }n\text{ is even}</math> "Math input error"
  • <math> a \text{ } b</math> "Math input error"
  • <math>( \nabla \times \mathbf{F} ) \cdot {\mathrm d}\mathbf{S} = \oint_{\partial S} \mathbf{F} \cdot {\mathrm d}\boldsymbol{\ell}</math> "math output error"
  • <math>\oint_C \mathbf{B} \cdot {\mathrm d} \boldsymbol{\ell} = \mu_0 </math> "math output error"
  • <chem>\mu-Cl</chem> "Math output error"
  • <chem>[Fe(\eta^5-C5H5)2]</chem> "Math output error"
  • <math chem>\begin{align}\overbrace{\ce{2Fe3O4}}^{\text{magnetite}} + \ce{1/2 O2 ->}\ &{\color{Brown}\overbrace{\ce{3(\lambda{-}Fe2O3)}}^{\text{maghemite}}}\\ \underbrace{\ce{2Fe3O4}}_{\text{magnetite}} + \ce{1/2 O2 ->}\ {\color{Red}\underbrace{\ce{3(\alpha{-}Fe2O3)}}_{\text{hematite}}} \end{align}</math> Math output error

problems with old mhchem syntax (ignored)

  • <chem>{C_\mathit{x}H_\mathit{y}} + \mathit{z}O2 -> {\mathit{x}CO2} + \frac{\mathit{y}}{2}H2O</chem> Failed to parse (syntax error): {\displaystyle \ce{{C_\mathit{x}H_\mathit{y}} + \mathit{z}O2 -> {\mathit{x}CO2} + \frac{\mathit{y}}{2}H2O}}
  • <chem>A ->[{}\atop x] B</chem> Failed to parse (syntax error): {\displaystyle \ce{A ->[{}\atop x] B}}
  • <chem>A ->[{}\atop\ce{+H2O}] B</chem> Failed to parse (syntax error): {\displaystyle \ce{A ->[{}\atop\ce{+H2O}] B}}

Open sub-tasks

  • Review the entire page again
  • \grave{a} too big T409110
  • \hat and \widehat look the same T409152 (ignore not important)
  • \vec is too large
  • \P is messed up
  • \sqrt[3]{x} 3 is too small

What should have happened instead?:

All equations rendered correctly

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

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

Google Chrome 128.0.6613.138 (Official Build) (64-bit) (cohort: Stable)

Related Objects

StatusSubtypeAssignedTask
OpenFeatureJeanCASPAR
OpenPhysikerwelt
OpenBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
DuplicateBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
DuplicateBUG REPORTNone
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedPhysikerwelt
ResolvedPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTJeanCASPAR
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
DuplicateBUG REPORTNone
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedPhysikerwelt
ResolvedPhysikerwelt
ResolvedPhysikerwelt
ResolvedPhysikerwelt
ResolvedPhysikerwelt
ResolvedPhysikerwelt
ResolvedPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
DuplicateBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
ResolvedBUG REPORTPhysikerwelt
OpenBUG REPORTNone
ResolvedBUG REPORTPhysikerwelt
OpenBUG REPORTNone

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Mh, there are quite some differences (even though ChatGPT does not see them)

  • \grave{a} too big T409110
  • \hat and \widehat look the same
  • \vec is too large
  • \P is messed up
  • \sqrt[3]{x} 3 is too small
  • c in large dfrac example is wrong
  • \smallmatrix is wrong

Maybe it would be better to run automated visual regression tests, like we did for the last switch in 2016 https://ceur-ws.org/Vol-1785/W48.pdf

I looked at \grave{a} and was unable to identify the underlying problem. The generated MathML code is identical to the MathML code generated by mathoid. If I render the resulting MathML code with the interactive Mathjax demo from https://mathjax.github.io/MathJax-demos-web/input/tex2mml.html the result looks fine

Screenshot 2025-11-02 at 05.44.08.png (1×1 px, 298 KB)

I looked at \grave{a} and was unable to identify the underlying problem. The generated MathML code is identical to the MathML code generated by mathoid. If I render the resulting MathML code with the interactive Mathjax demo from https://mathjax.github.io/MathJax-demos-web/input/tex2mml.html the result looks fine

Screenshot 2025-11-02 at 05.44.08.png (1×1 px, 298 KB)

I just tested different versions of MathJax and the formula is fixed in version 4.0.0: https://github.com/mathjax/MathJax/releases/tag/4.0.0-alpha.1.

Screenshot From 2025-11-03 19-02-02.png (44×48 px, 579 B)

Reviewing the open points with mj4.01 in svg mode

compare https://en.wikipedia.beta.wmcloud.org/wiki/Extension:Math/Help:Formula (with mathjax) to https://en.wikipedia.org/wiki/Help:Displaying_a_formula (in private tab)

\vec looks the same
\P looks the same
\sqrt[3] is less bold but not smaller (kind of ok)

Screenshot 2026-02-10 at 12.18.05.png (208×2 px, 86 KB)

c is still a bit small

Screenshot 2026-02-10 at 12.20.14.png (208×3 px, 148 KB)

smallmatrix is a bit to big

Screenshot 2026-02-10 at 12.21.39.png (202×2 px, 96 KB)

Physikerwelt changed the task status from In Progress to Open.Feb 10 2026, 11:22 AM
Physikerwelt updated the task description. (Show Details)
Physikerwelt moved this task from Ready to implement to Inbox on the Math board.

Hello @Physikerwelt ,

on the page https://de.wikipedia.org/wiki/Hilfe:TeX I found still some issues. For example will be <math>A \sqcup B</math> and <math>A { \sqcup } B</math> rendered the same way with mathjax and native mathml but in standard svg the spacing is different. And in my opinion the SVG rendering is the correct way.

Also on the page I found that <math>\not<</math> wont be rendered correctly with mathjax and native mathml. The line crossing out the symbol < is missing.

Shall I open new tickets for this issue?

The Tickets T414124 and T414130 should also not be forgotten.

Shall I open new tickets for this issue?

That would be excellent. I have the impression that the workflow to resolve all sub-tasks of this task works reasonably well.

c is still a bit small

Screenshot 2026-02-10 at 12.20.14.png (208×3 px, 148 KB)

smallmatrix is a bit to big

Screenshot 2026-02-10 at 12.21.39.png (202×2 px, 96 KB)

@Christian1985 Do you thinks the two above differences should be fixed, to make the MathJax rendering look like the SVG rendering, or is the MathJax rendering also ok?

Hello @Physikerwelt ,

yes I would say, that smallmatrix should be a bit smaller. Smallmatrix can be used inline and therefor ist to big. The fraction should also be adjusted. Not only is the c too small, but so is the first two. The fraction looks very ugly.

The new MathJax rendering appears somewhat more compact in its layout. Within running text, this generally results in a cleaner and more aesthetically pleasing presentation. However, in the sections on functional analysis and tensor analysis—both subfields of mathematics—formulas frequently contain a large number of indices, including nested indices. In the more condensed format, these expressions have become noticeably harder to read.

Here is a example:

image.png (293×2 px, 80 KB)

The same issue ocurres for roots
{F72231479}

Hello @Physikerwelt ,

yes I would say, that smallmatrix should be a bit smaller. Smallmatrix can be used inline and therefor ist to big. The fraction should also be adjusted. Not only is the c too small, but so is the first two. The fraction looks very ugly.

Thank you for adding the smallmatrix problem. Was the issue with the c resolved?

I was under the impression that there was a new bug report, but I could not find (the \vec also seemed to be familiar).

\vec looks the same

However, I was under the impression that this was as bad as before...

Hello @Physikerwelt ,

yes I would say, that smallmatrix should be a bit smaller. Smallmatrix can be used inline and therefor ist to big. The fraction should also be adjusted. Not only is the c too small, but so is the first two. The fraction looks very ugly.

Thank you for adding the smallmatrix problem. Was the issue with the c resolved?

Hello @Physikerwelt ,
today the issue with the c is fixed. Last week the issues still existed. May be ticket T418073 solved the issue also?!