It is possible to add scientific equations to your drills using the MathML standard. MathML is an XML-based language for describing mathematical notation. This page is by no means a MathML manual, but simply a quick introduction to MathML and how it applies to Drillster.
Equations are added to a drill by simply typing in or copying and pasting the MathML XML code into the edit screen after clicking on the MathML icon:
If Drillster recognizes your code as valid MathML, the text is automatically converted into a graphical representation of the equation. If your code contains an error, or if Drillster is unable to parse your MathML code, the code is saved as literal text instead. No error messages are shown.
Since the equation is converted to an image, it is not possible to edit the equation contents once an equation has been created. Changing an equation is best done by adding an alternative to the incorrect equation with your corrections, and subsequently deleting the incorrect alternative. For this reason, it is always advisable to keep a separate (text) file with your equation definitions.
An equation can be removed simply by clicking the small '×' next to the equation image, just like you would remove a regular image.
Equations can also be inserted as incorrect alternatives.
It is possible to add a caption to an equation by clicking on the equation image.
Since equations are handled as images by Drillster, there is no way an equation can be entered as the answer to an open-ended question.
<math xmlns="http://www.w3.org/1998/Math/MathML">
...
</math>
The XML preamble and DOCTYPE should not be included. A valid equation will always start with the math
tag.
MathML can be used to describe both the presentation and the meaning of an equation. Drillster uses the presentation variant of MathML. The mode="display"
attribute is not required.
Mathematics
A very simple example:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi>
<mo>+</mo>
<mn>5</mn>
<mo>=</mo>
<mn>0</mn>
</math>
Something slightly more advanced:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mfenced>
<mrow>
<mi>x</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</mfenced>
<mfenced>
<mrow>
<mi>x</mi>
<mo>-</mo>
<mn>5</mn>
</mrow>
</mfenced>
<mo>=</mo>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>-</mo>
<mn>2</mn>
<mi>x</mi>
<mo>-</mo>
<mn>15</mn>
</math>
This is the well known equation for solving quadratic polynomials:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo form="prefix">−<!-- minus sign --></mo>
<mi>b</mi>
<mo>±<!-- ± --></mo>
<msqrt>
<msup>
<mi>b</mi>
<mn>2</mn>
</msup>
<mo>−<!-- minus sign --></mo>
<mn>4</mn>
<mo>⁢<!-- ⁢ --></mo>
<mi>a</mi>
<mo>⁢<!-- ⁢ --></mo>
<mi>c</mi>
</msqrt>
</mrow>
<mrow>
<mn>2</mn>
<mo>⁢<!-- ⁢ --></mo>
<mi>a</mi>
</mrow>
</mfrac>
</mrow>
</math>
Using Fractions:
<math display='block'>
<mfrac linethickness='0.2ex'>
<mrow>
<mspace width = '1em'/>
<mfrac bevelled='true'>
<mn>1</mn>
<mn>2</mn>
</mfrac>
<mspace width = '1em' />
</mrow>
<mrow>
<mspace width = '1em' />
<mfrac bevelled='true'>
<mn>3</mn>
<mn>4</mn>
</mfrac>
<mspace width = '1em' />
</mrow>
</mfrac>
</math>
Change "true" to "false" to change the way of using the fraction
Matrices are defined as follows:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<matrix>
<matrixrow>
<cn> 0 </cn> <cn> 1 </cn> <cn> 0 </cn>
</matrixrow>
<matrixrow>
<cn> 0 </cn> <cn> 0 </cn> <cn> 2 </cn>
</matrixrow>
<matrixrow>
<cn> 3 </cn> <cn> 0 </cn> <cn> 0 </cn>
</matrixrow>
</matrix>
</math>
More advanced examples:
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML" id="schrodinger">
<mi title='Imaginary Unit'>i</mi>
<mi title="Reduced Plank's Constant">ℏ</mi>
<mfrac title="Partial Differential Operator">
<mo>∂</mo>
<mrow>
<mo>∂</mo>
<mi title="Time">t</mi>
</mrow>
</mfrac>
<mn title="Wavefunction">Ψ</mn>
<mo form="infix">=</mo>
<mfrac>
<mrow>
<mo form="infix" lucida="true">-</mo>
<msup>
<mi title="Plank's constant">h</mi>
<mn>2</mn>
</msup>
</mrow>
<mrow>
<mn>2</mn>
<mi title="Mass of particle">m</mi>
</mrow>
</mfrac>
<msup title="Laplacian">
<mo>∇</mo>
<mn>2</mn>
</msup>
<mn title="Wavefunction">Ψ</mn>
<mo form="infix">+</mo>
<mi title="Potential energy">V</mi>
<mn title="Wavefunction">Ψ</mn>
</math>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mrow>
<mfenced separators="|">
<mrow>
<mi>x</mi>
<mo>+</mo>
<mi>a</mi>
</mrow>
</mfenced>
</mrow>
<mrow>
<mi>n</mi>
</mrow>
</msup>
<mo>=</mo>
<mrow>
<msubsup>
<mo stretchy="true">â</mo>
<mrow>
<mi>k</mi>
<mo>=</mo>
<mn>0</mn>
</mrow>
<mrow>
<mi>n</mi>
</mrow>
</msubsup>
<mrow>
<mfenced separators="|">
<mrow>
<mfrac linethickness="0pt">
<mrow>
<mi>n</mi>
</mrow>
<mrow>
<mi>k</mi>
</mrow>
</mfrac>
</mrow>
</mfenced>
<msup>
<mrow>
<mi>x</mi>
</mrow>
<mrow>
<mi>k</mi>
</mrow>
</msup>
<msup>
<mrow>
<mi>a</mi>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</msup>
</mrow>
</mrow>
</math>
It is even possible to include colors in equations:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mi>e</mi>
<mrow mathcolor='#cc0000'>
<mn>2</mn>
<mi>x</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msup>
</math>
Reaction equations
MathML can also be used for reaction equations in chemistry and physics.
This equation describes the combustion of methane:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msub>
<mi>CH</mi>
<mn>4</mn>
</msub>
<mo>+</mo>
<mn>2</mn>
<msub>
<mi>O</mi>
<mn>2</mn>
</msub>
<mo>→</mo>
<msub>
<mi>CO</mi>
<mn>2</mn>
</msub>
<mo>+</mo>
<mn>2</mn>
<msub>
<mi>H</mi>
<mn>2</mn>
</msub>
<mi>O</mi>
</math>
An ionic reaction:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mi>Ca</mi>
<mo>2+</mo>
</msup>
<mo>+</mo>
<mn>2</mn>
<msup>
<mi>Cl</mi>
<mo>-</mo>
</msup>
<mo>+</mo>
<mn>2</mn>
<msup>
<mi>Ag</mi>
<mo>+</mo>
</msup>
<mo>+</mo>
<mn>2</mn>
<msup>
<msub>
<mi>NO</mi>
<mn>3</mn>
</msub>
<mi>-</mi>
</msup>
<mo>→</mo>
<msup>
<mi>Ca</mi>
<mo>2+</mo>
</msup>
<mo>+</mo>
<mn>2</mn>
<msup>
<msub>
<mi>NO</mi>
<mn>3</mn>
</msub>
<mi>-</mi>
</msup>
<mo>+</mo>
<mn>2</mn>
<mi>Ag</mi>
<mi>Cl</mi>
<mi>(s)</mi>
</math>
Fission of uranium:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mmultiscripts>
<mi>n</mi>
<mprescripts/> <mi>0</mi> <mi>1</mi>
</mmultiscripts>
<mo>+</mo>
<mmultiscripts>
<mi>U</mi>
<mprescripts/> <mi>92</mi> <mi>235</mi>
</mmultiscripts>
<mo>→</mo>
<mmultiscripts>
<mi>Ba</mi>
<mprescripts/> <mi>56</mi> <mi>141</mi>
</mmultiscripts>
<mo>+</mo>
<mmultiscripts>
<mi>Kr</mi>
<mprescripts/> <mi>36</mi> <mi>92</mi>
</mmultiscripts>
<mo>+</mo>
<mn>3</mn>
<mmultiscripts>
<mi>n</mi>
<mprescripts/> <mi>0</mi> <mi>1</mi>
</mmultiscripts>
</math>
These products have been tested to work correctly with Drillster:
- Online MathML conversion tool by Wolfram Research allows direct conversion to MathML from Mathematica notation and standard text-based notation
- Wiris Compatible with MathML and LaTeX
- MathType by Design Science allows you to draw an equation with a pen, digitize it and copy and paste the equation into Drillster in MathML format.
- Microsoft Word contains an equation editor for easy authoring of equations. Copy and paste your equations directly into Drillster. Make sure you select 'MathML' as the standard clipboard format for equations. The standard setting does not work.
- OpenOffice has native MathML support.
There are many more free and paid alternatives available. Please let us know if you have good experiences with another product that you feel should be listed here.
0 Comments