Page MenuHomePhabricator

Create correct sized fences around smallmatrix
Closed, ResolvedPublic

Description

  • From Feedback: The {smallmatrix} example has its fences wrapped in too many mrows I think, so it renders without stretching them in both Firefox and Chrome. Ideally you should be able to emit the <mo>(</mo> followed directly by an <mtable>, and trailed by <mo>)</mo>, and only wrap those 3 into a parent <mrow>.

Removing the mrows does not change the fences size wrap content.

LaTeX:
"\bigl( \begin{smallmatrix} a&b\\ c&d \end{smallmatrix} \bigr) "

MathJax creates MathML like this:

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow data-mjx-texclass="OPEN">
    <mo minsize="1.2em" maxsize="1.2em">(</mo>
  </mrow>
  <mtable data-mjx-smallmatrix="true" columnspacing="0.333em" rowspacing=".2em">
    <mtr>
      <mtd>
        <mi>a</mi>
      </mtd>
      <mtd>
        <mi>b</mi>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
        <mi>c</mi>
      </mtd>
      <mtd>
        <mi>d</mi>
      </mtd>
    </mtr>
  </mtable>
  <mrow data-mjx-texclass="CLOSE">
    <mo minsize="1.2em" maxsize="1.2em">)</mo>
  </mrow>
</math>

Is it somehow possible to remove mrows and have the fencing math operators auto adjust there size to the content in MathML ? What would be an example ?

Event Timeline

Change 965072 had a related patch set uploaded (by Stegmujo; author: Stegmujo):

[mediawiki/extensions/Math@master] Remove too many rows in smallmatrix

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

Change 965072 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Remove too many rows in smallmatrix

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

Physikerwelt assigned this task to Stegmujo.