Open saraOrkide opened 5 months ago
The output is correct for your MathML. Remember that a parenthesis with stretch to the size of the largest item in the mrow
(explicit or implied) that contains the parenthesis. To make sure parentheses are the same size, they should be in the same mrow. That is not the case for your expression. For example, the first cell of your mtable
contains
<msup>
<mrow>
<msub>
<mrow>
<mo>(</mo>
<mtext>a</mtext>
</mrow>
<mrow>
<mn>11</mn>
</mrow>
</msub>
<mo>)</mo>
</mrow>
<mrow>
<mtext>n</mtext>
</mrow>
</msup>
Note that the open and close parentheses are not at the same nesting level. The open parenthesis is inside an mrow
inside the msub
, while the close parenthesis is two levels higher in the mrow
for the msup
. You should move the <mo>(</mo>
to be outside the msub
element.
<msup>
<mrow>
<mo>(</mo>
<msub>
<mrow>
<mtext>a</mtext>
</mrow>
<mrow>
<mn>11</mn>
</mrow>
</msub>
<mo>)</mo>
</mrow>
<mrow>
<mtext>n</mtext>
</mrow>
</msup>
This will guarantee they both stretch to the same size. It is also more semantically correct. Your original indicates that the (a
has a subscript, whereas only the a
should. (Also, the subscript should really be <mn>1</mn><mn>1</mn>
, not <mn>11</mn>
as the subscript consists of two separate 1s for the row and column, not the single number 11 as your MathML indicates, but that is a separate issue.)
The change I suggest above will make both parentheses stretch to cover the subscripted a
, but if you don't want the parentheses to stretch, use <mo stretchy="false">(</mo>
and <mo stretchy="false">)</mo>
instead.
PS, this is essentially the same issue you have had at least three times before, where you don't seem to understand the MathML rules for stretchy characters. I encourage you to view the MathML specification to familiarize yourself with those rules. I am going to stop writing detailed answers for these, and simply refer you to my previous ones and the specification in the future.
Oh yes I understand and my apologies also thank you very much
Hello good time I have a problem in displaying Parentheses, As you can see in the picture, the second parenthesis has extended itself, but the first parenthesis has not done so. What can I do so that the second parenthesis does not extend, and if there is no way for it, the first parenthesis should be the same size as the second parenthesis.
using mathjax: mathjax-4.0.0-beta.4 , mml-chtml.js settings:
mml code: