Page MenuHomePhabricator

\begin{align} with font sizes specified show font size annotation [6pt] in MathML mode
Closed, ResolvedPublicBUG REPORT

Description

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

  • Set maths rendering mode to MathML
  • Add a page with \begin{align} environment and font sizes specified via \\[6pt]

For example
<math display="block">\begin{align}
\frac{dy}{du} &= f'(u) = e^u, \\[6pt]
\frac{du}{dv} &= g'(v) = \cos v, \\[6pt]
\frac{dv}{dx} &= h'(x) = 2x.
\end{align}</math>
Used on https://en.wikipedia.org/w/index.php?title=Chain_rule&oldid=1246397644#Composites_of_more_than_two_functions

What happens?:

The actual font size annotations are shown

image.png (77×192 px, 4 KB)

What should have happened instead?:

The lines should be displayed using a smaller font size

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

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

Chrome 128

Event Timeline

Also fails in Client Side MathJax mode.

In the SVG mode, the annotations are ignored, and the font size is unchanged.

We don't mention the font size annotation in help:Formula so it could be classed as unsupported. I'll remove the annotation from the Chain Rule page.

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

[mediawiki/extensions/Math@master] Ignore length specifications after linebreaks

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

Physikerwelt moved this task from Inbox to Code Review on the Math board.
Physikerwelt subscribed.

I suggest to add a grammar rule that ignores the optional length argument in line breaks

Change #1074542 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Ignore length specifications after linebreaks

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

It fails with an example mention at https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Mathematics#Phabricator_Bugs

::<math display="block">\begin{align}
\varpi &= [2,1,1,1,1,1,4,1,2,\ldots], \\[8mu]
2\varpi &= [5,4,10,2,1,2,3,29,\ldots], \\[5mu]
\frac{\varpi}{2} &= [1,3,4,1,1,1,5,2,\ldots], \\[2mu]
\frac{\varpi}{\pi} &= [0,1,5,21,3,4,14,\ldots].
\end{align}</math>

There is a live example on Beta at https://en.wikipedia.beta.wmflabs.org/wiki/T375295

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

[mediawiki/extensions/Math@master] Fix: Add missing latex length units

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

Change #1076194 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Fix: Add missing latex length units

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

Thank you again. This is extremly helpful and speeds up the development speed by orders of magnitude.

Screenshot_20240927-165513.jpg (2×1 px, 362 KB)

For the record, case 6b indeed renders well-aligned in Firefox, but still not in Safari and Chrome. In particular, the equal signs don't line up in those.

Maybe it is good enough, or perhaps an intended product decision by upstreams, but I figured I'd document it here for future reference. Perhaps worth reporting upstream, if not already?

Screenshot 2024-12-16 at 18.28.38.png (1×1 px, 426 KB)

  • test example with other rendering engines in different browsers
  • Consider representing the the TeX concept align with a different HTML structure