# Daniel I. Scully

## 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>:

1. <mmultiscripts>
2.  <mn>G</mn> <!-- the base -->
3. 
4.  <mi>i</mi> <!-- sub-script 1 -->
5.  <mi>j</mi> <!-- super-script 1 -->
6. 
7.  <mi>k</mi> <!-- sub-script 2 -->
8.  <mi>l</mi> <!-- super-script 2 -->
9. 
10.  <mi>m</mi> <!-- sub-script 3 -->
11.  <mi>n</mi> <!-- super-script 3 -->
12. </mmultiscript>
$G_{i}^{j}{}_{k}{}^{l}{}_{m}{}^{n}$

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:

1. <mmultiscripts>
2.  <mn>G<.mn> <!-- the base -->
3. 
4.  <mi>i</mi> <!-- sub-script 1 -->
5.  <none />
6. 
7.  <mi>k</mi> <!-- sub-script 2 -->
8.  <mi>l</mi> <!-- super-script 2 -->
9. 
10.  <none />
11.  <mi>n</mi> <!-- super-script 3 -->
12. </mmultiscript>
$G_{i}{}_{k}{}^{l}{}^{n}$

#### 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.

1. <mmultiscripts>
2.  <mn>G<mn> <!-- the base -->
3. 
4.  <mi>i</mi> <!-- sub-script 1 -->
5.  <none />
6. 
7.  <mi>k</mi> <!-- sub-script 2 -->
8.  <mi>l</mi> <!-- super-script 2 -->
9. 
10.  <mprescripts />
11. 
12.  <none />
13.  <mi>a</mi> <!-- pre-super-script 1 -->
14. 
15.  <mi>b</mi> <!-- pre-sub-script 2 -->
16.  <mi>c</mi> <!-- pre-super-script 2 -->
17. </mmultiscript>
${}^{a}{}_{b}{}^{c}G_{i}{}_{k}{}^{l}$