Skip to content

msubsup issue

Volker Sorge edited this page Apr 20, 2015 · 9 revisions

Issue. Back to list of issues.

The Msubsup issue

Msubsup are broken up in the semantic tree into explicit subscripts and superscripts if advisable.

Original MathML:

<math>
  <msubsup>
    <mi>a</mi>
    <mi>b</mi>
    <mi>c</mi>
  </msubsup>
</math>

Semantic Tree:

<stree>
  <superscript role="latinletter" id="4">
    <children>
      <subscript role="subsup" id="3">
        <children>
          <identifier role="latinletter" font="italic" id="0">a</identifier>
          <identifier role="latinletter" font="italic" id="1">b</identifier>
        </children>
      </subscript>
      <identifier role="latinletter" font="italic" id="2">c</identifier>
    </children>
  </superscript>
</stree>

Straightforward translation of the semantic tree into the MathML element, naturally ruins the msubsup element. Here's the semantically enriched MathML:

<math>
  <msubsup semantic-type="superscript" semantic-role="latinletter" semantic-id="4" semantic-children="3,2">
    <mrow semantic-type="subscript" semantic-role="subsup" semantic-id="3" semantic-children="0,1" semantic-parent="4">
      <mi semantic-type="identifier" semantic-role="latinletter" semantic-id="0" semantic-parent="3">a</mi>
      <mi semantic-type="identifier" semantic-role="latinletter" semantic-id="1" semantic-parent="3">b</mi>
    </mrow>
    <mi semantic-type="identifier" semantic-role="latinletter" semantic-id="2" semantic-parent="4">c</mi>
  </msubsup>
</math>

Observe that this does not affect elements where msubsup has discernably been used as a layout element. See, for example the following sum expression:

<math>
  <msubsup>
    <mo></mo>
    <mi>b</mi>
    <mi>c</mi>
  </msubsup>
</math>

Semantic Tree:

<stree>
  <limboth role="sum" id="3">
    <children>
      <largeop role="sum" id="0"></largeop>
      <identifier role="latinletter" font="italic" id="1">b</identifier>
      <identifier role="latinletter" font="italic" id="2">c</identifier>
    </children>
  </limboth>
</stree>

Semantically enriched MathML:

<math>
  <msubsup semantic-type="limboth" semantic-role="sum" semantic-id="3" semantic-children="0,1,2">
    <mo semantic-type="largeop" semantic-role="sum" semantic-id="0" semantic-parent="3"></mo>
    <mi semantic-type="identifier" semantic-role="latinletter" semantic-id="1" semantic-parent="3">b</mi>
    <mi semantic-type="identifier" semantic-role="latinletter" semantic-id="2" semantic-parent="3">c</mi>
  </msubsup>
</math>
Clone this wiki locally