ASCIIMathML Enrichment Demo
Input
This demo is similar to the MathML Semantic Enrichnment Demo but uses ASCIIMathML as an alternative input format, which provides real-time feedback as you type but can often generate MathML with odd semantics in it. SnuggleTeX includes some functionality that can to convert this raw MathML into something equivalent to its own MathML output, thereby allowing you to semantically enrich it in certain simple cases, making ASCIIMathML a possibly viable input format for simple semantic maths.
To try the demo, simply enter some some ASCIIMathML into the box below. You should see a real time preview of this while you type. Then hit Go! to use SnuggleTeX to semantically enrich your input.
Live Preview
This is a MathML rendering of your input, generated by ASCIIMathML as you type.
This is the underlying MathML source generated by ASCIIMathML, again updated in real time.
Enhanced Presentation MathML
This shows the result of attempting to enrich the raw Presentation MathML generated by ASCIIMathML:
<math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mrow> <mrow> <mi>cos</mi> <mo>⁡</mo> <mfenced close=")" open="("> <mi>theta</mi> </mfenced> </mrow> <mo>⋅</mo> <mfenced close="]" open="["> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> </mrow> <mo>+</mo> <mrow> <mi>i</mi> <mo>⋅</mo> <mrow> <mi>sin</mi> <mo>⁡</mo> <mfenced close=")" open="("> <mi>theta</mi> </mfenced> </mrow> <mo>⋅</mo> <mfenced close="]" open="["> <mtable> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> </mtable> </mfenced> </mrow> </mrow> </math>
Content MathML
This shows the result of an attempted conversion to Content MathML:
<math xmlns="http://www.w3.org/1998/Math/MathML"> <apply> <plus/> <apply> <times/> <apply> <cos/> <ci>theta</ci> </apply> <list> <matrix> <vector> <cn>1</cn> <cn>0</cn> </vector> <vector> <cn>0</cn> <cn>1</cn> </vector> </matrix> </list> </apply> <apply> <times/> <ci>i</ci> <apply> <sin/> <ci>theta</ci> </apply> <list> <matrix> <vector> <cn>0</cn> <cn>1</cn> </vector> <vector> <cn>1</cn> <cn>0</cn> </vector> </matrix> </list> </apply> </apply> </math>
Maxima Input Form
This shows the result of an attempted conversion to Maxima Input syntax:
The conversion from Content MathML to Maxima Input was not successful for this input.
Failure Code | Message | XPath | Context |
---|---|---|---|
UMFG00 | Content MathML element matrix not supported | apply[1]/apply[1]/list[1]/matrix[1] | <matrix> <vector> <cn>1</cn> <cn>0</cn> </vector> <vector> <cn>0</cn> <cn>1</cn> </vector> </matrix> |
UMFG00 | Content MathML element matrix not supported | apply[1]/apply[2]/list[1]/matrix[1] | <matrix> <vector> <cn>0</cn> <cn>1</cn> </vector> <vector> <cn>1</cn> <cn>0</cn> </vector> </matrix> |
MathML Parallel Markup
This shows the enhanced Presentation MathML with other forms encapsulated as annotations:
<math xmlns="http://www.w3.org/1998/Math/MathML"> <semantics> <mrow> <mrow> <mrow> <mi>cos</mi> <mo>⁡</mo> <mfenced close=")" open="("> <mi>theta</mi> </mfenced> </mrow> <mo>⋅</mo> <mfenced close="]" open="["> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> </mrow> <mo>+</mo> <mrow> <mi>i</mi> <mo>⋅</mo> <mrow> <mi>sin</mi> <mo>⁡</mo> <mfenced close=")" open="("> <mi>theta</mi> </mfenced> </mrow> <mo>⋅</mo> <mfenced close="]" open="["> <mtable> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> </mtable> </mfenced> </mrow> </mrow> <annotation-xml encoding="MathML-Content"> <apply> <plus/> <apply> <times/> <apply> <cos/> <ci>theta</ci> </apply> <list> <matrix> <vector> <cn>1</cn> <cn>0</cn> </vector> <vector> <cn>0</cn> <cn>1</cn> </vector> </matrix> </list> </apply> <apply> <times/> <ci>i</ci> <apply> <sin/> <ci>theta</ci> </apply> <list> <matrix> <vector> <cn>0</cn> <cn>1</cn> </vector> <vector> <cn>1</cn> <cn>0</cn> </vector> </matrix> </list> </apply> </apply> </annotation-xml> <annotation encoding="ASCIIMathInput"/> <annotation-xml encoding="Maxima-upconversion-failures"> <s:fail xmlns:s="http://www.ph.ed.ac.uk/snuggletex" code="UMFG00" message="Content MathML element matrix not supported"> <s:arg>matrix</s:arg> <s:xpath>apply[1]/apply[1]/list[1]/matrix[1]</s:xpath> <s:context> <matrix> <vector> <cn>1</cn> <cn>0</cn> </vector> <vector> <cn>0</cn> <cn>1</cn> </vector> </matrix> </s:context> </s:fail> <s:fail xmlns:s="http://www.ph.ed.ac.uk/snuggletex" code="UMFG00" message="Content MathML element matrix not supported"> <s:arg>matrix</s:arg> <s:xpath>apply[1]/apply[2]/list[1]/matrix[1]</s:xpath> <s:context> <matrix> <vector> <cn>0</cn> <cn>1</cn> </vector> <vector> <cn>1</cn> <cn>0</cn> </vector> </matrix> </s:context> </s:fail> </annotation-xml> </semantics> </math>