Examples¶
Supported MathML Elements¶
Superscripts and Subscripts <msup>, <msub>, <msubsup>¶
MathML
<math>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
</math>
Square Root <msqrt>¶
MathML
<math>
<msqrt>
<mi>x</mi>
</msqrt>
</math>
N-root <mroot>¶
MathML
<math>
<mroot>
<mi>x</mi>
<mn>n</mn>
</mroot>
</math>
Fractions <mfrac>¶
MathML
<math>
<mfrac>
<mrow>
<mi>x</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
<mrow>
<mi>y</mi>
</mrow>
</mfrac>
</math>
Over/Under <mover>, <munder>¶
MathML
<math>
<mover accent="true">
<mrow>
<mi> x </mi>
<mo> + </mo>
<mi> y </mi>
<mo> + </mo>
<mi> z </mi>
</mrow>
<mo> ⏞ <!--TOP CURLY BRACKET--> </mo>
</mover>
</math>
Fenced <mfenced>¶
MathML
<math>
<mfenced>
<mn>a</mn>
<mn>b</mn>
<mn>c</mn>
</mfenced>
</math>
Tables <mtable>¶
MathML
<math>
<mfenced>
<mtable>
<mtr>
<mtd> <mn>x</mn> </mtd>
</mtr>
<mtr>
<mtd> <mn>y</mn> </mtd>
</mtr>
<mtr>
<mtd> <mn>z</mn> </mtd>
</mtr>
</mtable>
</mfenced>
</math>
Enclosures <menclose>¶
notation=”box”¶
MathML
<math>
<menclose notation="box">
<msup><mi>a</mi><mn>2</mn></msup>
<mo>+</mo>
<msup><mi>b</mi><mn>2</mn></msup>
</menclose>
</math>
notation=”updiagonalstrike downdiagonalstrike”¶
MathML
<math>
<mfrac>
<mrow><mn>1</mn></mrow>
<mrow>
<msup><mi>a</mi><mn>2</mn></msup>
<mo>+</mo>
<menclose notation="updiagonalstrike downdiagonalstrike">
<msup><mi>b</mi><mn>2</mn></msup>
</menclose>
</mrow>
</mfrac>
</math>
Color and Highlight attributes¶
mathcolor¶
MathML
<math>
<msup>
<mi>e</mi>
<mrow mathcolor='#cc0000'>
<mn>2</mn>
<mi>x</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msup>
</math>
mathbackground¶
MathML
<math>
<mfrac>
<mrow mathbackground="yellow">
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
</mrow>
<mi>c</mi>
</mfrac>
</math>
Latex¶
zm.Latex(r'x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}')
zm.Latex(r'i \hbar \frac{\partial}{\partial t}\Psi(\mathbf{r},t) = \hat H \Psi(\mathbf{r},t)')
zm.Latex(r'\Delta v = v_e \, \ln \frac{m_0}{m_f} = I_{sp} \, g_0 \, \ln \frac{m_0}{m_f}')