MathML
Export
translate a Maple expression into a MathML expression
ExportContent
translate a Maple expression into a content-only MathML expression
ExportPresentation
translate a Maple expression into a presentation-only MathML expression
Calling Sequence
Parameters
Description
Examples
Export( expr )
ExportContent( expr )
ExportPresentation( expr )
expr
-
any Maple expression that can be represented in MathML
Exporting a Maple expression as MathML produces a representation of the expression as MathML-encoded text. This text is produced in the form of a Maple string which may then be printed or otherwise processed further.
Three forms of exported MathML-encoded text are supported by the MathML package:
Parallel MathML encoding where both explicit presentation markup and explicit content markup for an expression are represented in a pair of tree data structures,
Content-only MathML encoding, and
Presentation-only MathML encoding.
Maple expressions are exported as MathML-encoded text by using either of the routines Export (to produce a parallel MathML encoding) and ExportContent (to produce a content-only MathML encoding). To support legacy browsers that do not understand content annotations, a third routine ExportPresentation is provided that removes the Maple and content annotations from the expression produced by Export.
Each of these routines accepts a single Maple expression as an argument. If the translation from Maple to MathML is possible, the MathML-encoded textual representation of the Maple expression is returned as a string. Otherwise, an error is returned.
The precise structure of the parallel MathML encoding is a tree-like data structure that consists of three parts.
The main branch consists of a presentation-only MathML encoding for use by rendering software.
The second part is an XML annotation that consists of a content-only MathML encoding for use by computational applications.
Finally, a textual annotation that consists of the Maple syntax for the input expression is attached for use by Maple itself, should it encounter its own output.
The structure of the content-only MathML encoding consists of only the second part of the parallel encoding. The content-only MathML format is used in communication with computational applications that require semantically accurate representations. This form can be generated both quickly and accurately, so a separate routine ExportContent was provided for producing this encoding.
The structure of the presentation-only MathML encoding consists of the first branch of the parallel encoding. It operates by generating a full parallel encoding, and then eliding the semantic annotations. Thus, unlike ExportContent, the procedure ExportPresentation is not more efficient than Export.
You can use the routine XMLTools[Print] to format the display of the strings returned by MathML[Export], MathML[ExportContent], and MathML[ExportPresentation].
This function is part of the MathML package, and so it can be used in the form Export(..) only after executing the command with(MathML). However, it can always be accessed through the long form of the command by using the form MathML[Export](..).
MathMLExport⁡a+2⁢b
<math xmlns='http://www.w3.org/1998/Math/MathML'><semantics><mrow xref='id5'><mi xref='id1'>a</mi><mo>+</mo><mrow xref='id4'><mn xref='id2'>2</mn><mo>⁢</mo><mi xref='id3'>b</mi></mrow></mrow><annotation-xml encoding='MathML-Content'><apply id='id5'><plus/><ci id='id1'>a</ci><apply id='id4'><times/><cn id='id2' type='integer'>2</cn><ci id='id3'>b</ci></apply></apply></annotation-xml><annotation encoding='Maple'>a+2*b</annotation></semantics></math>
XMLToolsPrint⁡
<math xmlns='http://www.w3.org/1998/Math/MathML'> <semantics> <mrow xref='id5'> <mi xref='id1'>a</mi> <mo>+</mo> <mrow xref='id4'> <mn xref='id2'>2</mn> <mo>⁢</mo> <mi xref='id3'>b</mi> </mrow> </mrow> <annotation-xml encoding='MathML-Content'> <apply id='id5'> <plus/> <ci id='id1'>a</ci> <apply id='id4'> <times/> <cn id='id2' type='integer'>2</cn> <ci id='id3'>b</ci> </apply> </apply> </annotation-xml> <annotation encoding='Maple'>a+2*b</annotation> </semantics> </math>
MathMLImport⁡
a+2⁢b
MathMLExportPresentation⁡a+2⁢b
<math xmlns='http://www.w3.org/1998/Math/MathML'><mrow><mi>a</mi><mo>+</mo><mrow><mn>2</mn><mo>⁢</mo><mi>b</mi></mrow></mrow></math>
MathMLExportContent⁡Int⁡sin⁡x−cos⁡x,x=0..π2
<math xmlns='http://www.w3.org/1998/Math/MathML'><apply id='id13'><int/><bvar><ci id='id5'>x</ci></bvar><lowlimit><cn id='id1' type='integer'>0</cn></lowlimit><uplimit><apply id='id4'><times/><cn id='id2' type='rational'>1<sep/>2</cn><pi id='id3'/></apply></uplimit><apply id='id12'><minus/><apply id='id8'><sin id='id6'/><ci id='id7'>x</ci></apply><apply id='id11'><cos id='id9'/><ci id='id10'>x</ci></apply></apply></apply></math>
<math xmlns='http://www.w3.org/1998/Math/MathML'> <apply id='id13'> <int/> <bvar> <ci id='id5'>x</ci> </bvar> <lowlimit> <cn id='id1' type='integer'>0</cn> </lowlimit> <uplimit> <apply id='id4'> <times/> <cn id='id2' type='rational'> 1 <sep/> 2 </cn> <pi id='id3'/> </apply> </uplimit> <apply id='id12'> <minus/> <apply id='id8'> <sin id='id6'/> <ci id='id7'>x</ci> </apply> <apply id='id11'> <cos id='id9'/> <ci id='id10'>x</ci> </apply> </apply> </apply> </math>
MathMLImportContent⁡
∫0π2sin⁡x−cos⁡xⅆx
ode≔diff⁡y⁡x,x−y⁡x2+y⁡x⁢sin⁡x−cos⁡x
ode≔ⅆⅆxy⁡x−y⁡x2+y⁡x⁢sin⁡x−cos⁡x
MathMLExportContent⁡ode
<math xmlns='http://www.w3.org/1998/Math/MathML'><apply id='id21'><plus/><apply id='id5'><diff/><bvar><ci id='id1'>x</ci></bvar><apply id='id4'><ci id='id2'>y</ci><ci id='id3'>x</ci></apply></apply><apply><minus/><apply id='id10'><power/><apply id='id8'><ci id='id6'>y</ci><ci id='id7'>x</ci></apply><cn id='id9' type='integer'>2</cn></apply></apply><apply id='id17'><times/><apply id='id13'><ci id='id11'>y</ci><ci id='id12'>x</ci></apply><apply id='id16'><sin id='id14'/><ci id='id15'>x</ci></apply></apply><apply><minus/><apply id='id20'><cos id='id18'/><ci id='id19'>x</ci></apply></apply></apply></math>
<math xmlns='http://www.w3.org/1998/Math/MathML'> <apply id='id21'> <plus/> <apply id='id5'> <diff/> <bvar> <ci id='id1'>x</ci> </bvar> <apply id='id4'> <ci id='id2'>y</ci> <ci id='id3'>x</ci> </apply> </apply> <apply> <minus/> <apply id='id10'> <power/> <apply id='id8'> <ci id='id6'>y</ci> <ci id='id7'>x</ci> </apply> <cn id='id9' type='integer'>2</cn> </apply> </apply> <apply id='id17'> <times/> <apply id='id13'> <ci id='id11'>y</ci> <ci id='id12'>x</ci> </apply> <apply id='id16'> <sin id='id14'/> <ci id='id15'>x</ci> </apply> </apply> <apply> <minus/> <apply id='id20'> <cos id='id18'/> <ci id='id19'>x</ci> </apply> </apply> </apply> </math>
ⅆⅆxy⁡x−y⁡x2+y⁡x⁢sin⁡x−cos⁡x
mml≔MathMLExport⁡ode:
MathMLImport⁡mml
See Also
codegen[eqn]
codegen[MathML]
Copy as MathML
Exporting as MathML
InertForm[ToMathML]
latex
MathML[Import]
MathML[ImportContent]
XMLTools
XMLTools[Print]
Download Help Document