A Beginner's Guide to MathML
Tensors and Pre-scripts
Tensor notation
In the previous section we applied single sub-scripts and super-scripts to elements, but tensors require multiple indices. The element used to achieve this is <mmultiscripts>:
<mmultiscripts>
<mn>G</mn> <!-- the base -->
<mi>i</mi> <!-- sub-script 1 -->
<mi>j</mi> <!-- super-script 1 -->
<mi>k</mi> <!-- sub-script 2 -->
<mi>l</mi> <!-- super-script 2 -->
<mi>m</mi> <!-- sub-script 3 -->
<mi>n</mi> <!-- super-script 3 -->
</mmultiscript>
The first tag inside the <mmultiscripts> is the base element, ie: the element to which the inices are being applied.
After the base comes sub-script super-script pairs, with the first pair appearing closest to the base element, and successive pairs getting further away.
When an element is not required in one of the sub-script or super-script pairs, the <none /> tag is used to take its place so that a pair is always provided:
<mmultiscripts>
<mn>G<.mn> <!-- the base -->
<mi>i</mi> <!-- sub-script 1 -->
<none />
<mi>k</mi> <!-- sub-script 2 -->
<mi>l</mi> <!-- super-script 2 -->
<none />
<mi>n</mi> <!-- super-script 3 -->
</mmultiscript>
Pre-scripts
The <mmultiscripts> can be extended even further by adding pre-scripts.
When all the required sub-script super-script pairs have been added, insert the empty <mprescripts /> tag. Then follow it by more sub-script super-script pairs which will be rendered as pre-scripts from left to right. So the first pair will appear furthest from the base element and the last pair closest.
<mmultiscripts>
<mn>G<mn> <!-- the base -->
<mi>i</mi> <!-- sub-script 1 -->
<none />
<mi>k</mi> <!-- sub-script 2 -->
<mi>l</mi> <!-- super-script 2 -->
<mprescripts />
<none />
<mi>a</mi> <!-- pre-super-script 1 -->
<mi>b</mi> <!-- pre-sub-script 2 -->
<mi>c</mi> <!-- pre-super-script 2 -->
</mmultiscript>