Page MenuHomePhabricator

Using MathJax - Too large space after and before operatores
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
Christian1985
Feb 16 2026, 6:01 PM
Referenced Files
F73037411: Screenshot 2026-03-18 at 22.52.23.png
Mar 18 2026, 9:53 PM
F72867788: Screenshot 2026-03-15 at 08.28.43.png
Mar 15 2026, 7:29 AM
F72867778: Screenshot 2026-03-15 at 07.54.37.png
Mar 15 2026, 7:29 AM
F72692998: Screenshot 2026-03-08 at 07.48.31.png
Mar 8 2026, 6:50 AM
F72185235: Screenshot 2026-02-19 at 21.08.42.png
Feb 19 2026, 8:09 PM
F72134809: image.png
Feb 16 2026, 6:01 PM

Description

I'm using Ubuntu 24.04, Chrome and Wikimedia 1.46.0-alpha (a6b78ca) 08:35, 16. Feb. 2026 mit MathJax rendering.

If you render the code
<math>A {\bigsqcup} B</math>,
<math>A {\sqcup} B</math> and
<math>A {\sqsubset} B</math> with MathJax, the spacing before and after the operator is incorrect. The spacing is too large. I have not tested other operators.

image.png (250×740 px, 48 KB)

Event Timeline

Christian1985 renamed this task from Too large space after and before operatores to Using MAthJax - Too large space after and before operatores.Feb 16 2026, 6:02 PM

Let's check mathoid renderes

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block" alttext="A{\sqcup }B">
  <semantics>
    <mrow>
      <mi>A</mi>
      <mrow class="MJX-TeXAtom-ORD">
        <mo>⊔<!-- ⊔ --></mo>
      </mrow>
      <mi>B</mi>
    </mrow>
    <annotation encoding="application/x-tex">A{\sqcup }B</annotation>
  </semantics>
</math>

and

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block" alttext="A\sqcup B">
  <semantics>
    <mrow>
      <mi>A</mi>
      <mo>⊔<!-- ⊔ --></mo>
      <mi>B</mi>
    </mrow>
    <annotation encoding="application/x-tex">A\sqcup B</annotation>
  </semantics>
</math>

so the only noticeable difference is the additional mrow with class="MJX-TeXAtom-ORD"

I tex it also renders with different spaces

Screenshot 2026-03-08 at 07.48.31.png (80×538 px, 8 KB)

currently for wikitexvc the output of both is exactly the same.

<math xmlns="http://www.w3.org/1998/Math/MathML" class="mwe-math-element mwe-math-element-inline"><mrow data-mjx-texclass="ORD"><mstyle displaystyle="true" scriptlevel="0"><mi>A</mi><mo stretchy="false">⊔</mo><mi>B</mi></mstyle></mrow></math>

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

[mediawiki/extensions/Math@master] WIP: Render curlies with 1 element if it produces operators

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

This can be fixed easily. However, it has some side effects. Thus we need to discuss that it does not break more than it fixes. It is also related to the general discussion how to represent {} internally in T419194

Aklapper renamed this task from Using MAthJax - Too large space after and before operatores to Using MathJax - Too large space after and before operatores.Mar 8 2026, 8:29 PM

I found another solution, without adding mrows, and did also check for potential regressions.

Screenshot 2026-03-15 at 07.54.37.png (352×472 px, 34 KB)

the only difference is that the spacing around def got smaller with native rendering, which seems to be okay as it get's closer to the previous (SVG) rendering.

Screenshot 2026-03-15 at 08.28.43.png (332×394 px, 32 KB)

Change #1249039 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Render curlies with 1 element if it produces operators

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