Page MenuHomePhabricator

\overline{ABC} renders the bar too small in native-MathML mode
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
SalixAlba
Aug 11 2026, 10:53 AM
Project Tags
Referenced Files
F102251767: Screenshot 2026-09-09 at 05.27.07.png
Sep 9 2026, 4:33 AM
F102249600: Screenshot 2026-09-09 at 04.54.40.png
Sep 9 2026, 4:04 AM
F102231688: Screenshot 2026-09-08 at 3.04.36 PM.png
Sep 8 2026, 10:05 PM
F100195744: Screenshot 2026-08-26 at 11.15.42.png
Aug 26 2026, 9:19 AM
F100195539: Screenshot 2026-08-26 at 11.10.27.png
Aug 26 2026, 9:19 AM
F100195086: document_D265_1625129.pdf
Aug 26 2026, 9:19 AM
F99143691: Screenshot 2026-08-19 at 11.38.07.png
Aug 19 2026, 6:42 PM
F98062902: image.png
Aug 11 2026, 12:04 PM

Description

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

  • Set math rendering mode to Native-MathML or Client SVG
  • Enter the formula
\overline\alpha\ \bar\beta\ \overline{ABC}\ \bar{DEF}

What happens?:

Rendered as

image.png (307×112 px, 8 KB)

image.png (351×129 px, 12 KB)

What should have happened instead?:

Rendered with longer-thinker bars for '\overline' but short bars for '\bar'

image.png (436×262 px, 27 KB)

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

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

Browser ecosia (chromium)

Test case at https://www.mediawiki.org/wiki/Extension:Math/Native_MathML/Reported_Cases#New_cases_since_Aug_2026

Event Timeline

Curiously, \overline{ABC} is the correct length and \bar{DEF} too short in both the server-side modes.

image.png (436×262 px, 27 KB)

This summary backwards. The "client SVG" behavior is wrong and the "server SVG" behavior is correct.

\bar is not "too short". It is supposed to render like that, as a particular single glyph over whatever you ask it to wrap. We should copy the behavior from LaTeX, not invent different behavior that we think would be better in some context.

If someone wants an extended overline, they shouldn't use \bar.

Also, the "MathML" version looks like this in my browser (Safari 18):

Screenshot 2026-08-11 at 4.35.39 AM.png (240×138 px, 9 KB)

Firefox gives

image.png (312×103 px, 9 KB)

Different behaviour point to problems with the browsers rendering of MathML rather our generated mathml.

problems with the browsers rendering of MathML rather our generated mathml.

Or both. But the inter-browser inconsistency makes working around the problem almost impossible.

Krinkle triaged this task as High priority.EditedAug 19 2026, 6:42 PM
Krinkle subscribed.

Suggesting priority "High", specifically for \bar{DEF} rendering a short instead of long overline above "DEF" in client side MathJax.

Screenshot 2026-08-19 at 11.38.07.png (1,549×555 px, 120 KB)

Internally we can see that MathJax v2.x (server) produces MathML that Chrome renders as all-short, whereas MediaWiki produces MathML that Firefox renders as all-long.

Can we split this into tickets for MathJax and Native MathML rendering separately?

Physikerwelt subscribed.

@MSantos, I suggest splitting up T435456 as this is less browser-related.

Krinkle lowered the priority of this task from High to Medium.Aug 20 2026, 7:21 PM

Thanks, this is closer to the intention of \bar.

Can the lines be made slightly chunkier? The updated version still seems kind of anemic compared to the text font, and would be more legible if thickened up a bit.

Physikerwelt claimed this task.

I compiled it with LaTeX using https://latex3.github.io/tagging-project/documentation/usage-instructions


If I render it looks very similar to what MathJax produces
Screenshot 2026-08-26 at 11.10.27.png (336×88 px, 6 KB)

Screenshot 2026-08-26 at 11.15.42.png (236×55 px, 6 KB)

both versions generate the unicode char 00AF https://unicode-explorer.com/c/00AF for bar and 203E https://unicode-explorer.com/c/203E for overline.
I don't see a way to change this, as this is a decision of the font designer.

This comment was removed by Jacobolus.

\overline{\alpha} is still incorrect in "client-side SVG" mode. It renders too close to the letter and is not properly horizontally aligned. (This should maybe be recorded as a different ticket.)

Here's what it looks like in LaTeX:

Screenshot 2026-09-08 at 3.04.36 PM.png (94×104 px, 5 KB)

The overline indeed appeared further to the left in the old MathJax server, compared to the new client mode. This seems to be an intentional change in upstream MathJax between v2 and v4, rather than anything we control, i.e. the differenve between running MathJax server-side vs client-side, or the difference between MediaWiki MathML vs MathJax MathML.

Here are the two of them compared to the latest demo at https://www.mathjax.org/#demo, where both LaTeX parsing and SVG rendering are performed by MathJax, the same way that Mathoid does:

Screenshot 2026-09-09 at 04.54.40.png (788×458 px, 56 KB)

  • MathJax-server SVG (MathJax v2 LaTeX-MathML + MathJax v2 SVG, from wikimedia.org Mathoid)
  • MathJax-client SVG (MediaWiki LaTeX-MathML + MathJax v4 SVG)
  • MathJax demo (MathJax v4 LaTeX-MathML + MathJax v4 SVG)

This seems to be an intentional change in upstream MathJax

This is false, as your own screenshot demonstrates.

Both versions of MathJax, as well as standard LaTeX, have relatively similar output, with an overline that stretches over the horizontal extent of the symbol, more or less from the furthest-left point to the furthest-right point. (In fact, in all three the overline extends very slightly beyond the symbol to each side, in a symmetrical way.)

By comparison the mediawiki "client-side SVG" mode does something obviously wrong, not extending far enough to the left and extending much too far to the right, as well as sitting much closer to the symbol than either version of MathJax.

I see. I was focussing at the horizonal length and distance rather than vertical. That part indeed seems unchanged in MathJax SVG, but is due to a difference in MathML expression:

MathJax demo
$\overline{\alpha}$

<!-- MathJax v4 MathML -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mover>
    <mi>&#x3B1;</mi><mo accent="true">&#x2015;</mo>
  </mover></math>

<!-- MediaWiki MathML -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow data-mjx-texclass="ORD"><mstyle displaystyle="true" scriptlevel="0"><mrow data-mjx-texclass="ORD"><mover>
      <mi>α</mi><mo>‾</mo>
    </mover></mrow></mstyle></mrow></math>

<!-- MediaWiki MathML + accent=true -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow data-mjx-texclass="ORD"><mstyle displaystyle="true" scriptlevel="0"><mrow data-mjx-texclass="ORD"><mover>
      <mi>α</mi><mo accent="true">‾</mo>
    </mover></mrow></mstyle></mrow></math>

<!-- MediaWiki MathML + &#x2015; -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow data-mjx-texclass="ORD"><mstyle displaystyle="true" scriptlevel="0"><mrow data-mjx-texclass="ORD"><mover>
      <mi>α</mi><mo>&#x2015;</mo>
    </mover></mrow></mstyle></mrow></math>

<!-- MediaWiki MathML + &#x2015;  + accent=true -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow data-mjx-texclass="ORD"><mstyle displaystyle="true" scriptlevel="0"><mrow data-mjx-texclass="ORD"><mover>
      <mi>α</mi><mo accent="true">&#x2015;</mo>
    </mover></mrow></mstyle></mrow></math>

Screenshot 2026-09-09 at 05.27.07.png (638×1,244 px, 193 KB)

I filed T437402: \overline{ABC} renders the bar too low and too thin to follow-up on this.

The horizontal length is about right, but the horizontal position is wrong. (The vertical position is also wrong.)

You should try to test out a variety of letters, symbols, combinations of letters, bigger groups of symbols, etc., and make sure that in every case the results are similar to the results produced by LaTeX.

For example, the result of \overline{a} is also incorrect in "client-side SVG" mode, but in that case, in addition to being too low and too far to the right, the line is also not long enough.