此为 Mathematica 8 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)

MathML (.mml)

MIME type: text/mathml, application/mathml+xml
MathML mathematical markup language.
Used for integrating mathematical formulas in web documents.
Rendering of embedded MathML is supported by a number of browsers and browser additions.
Specifies the presentation and the semantic content of mathematical formulas.
XML-based format.
Based on a draft that was derived from the Mathematica typesetting language.
Introduced in 1999 and updated in 2003 by the W3C math working group.
  • Import and Export fully support the MathML 2.0 specification.
  • Import imports a MathML file and returns a box expression.
  • Export exports an arbitrary expression to MathML.
  • Import["file.mml"] reads the MathML presentation elements from a file and converts them to the corresponding Mathematica box expression.
  • Import["file.mml", "Expression"] converts MathML to a Mathematica expression using TraditionalForm interpretation rules.
  • Export["file.mml", expr] converts a box expression or an arbitrary Mathematica expression to MathML.
  • When exporting an arbitrary mathematical expression, its presentation and its context are represented in the resulting MathML.
  • Import imports the specified element from a MathML file.
  • Import imports multiple elements.
  • The import format can be specified with Import["file", "MathML"] or Import.
  • Export creates a MathML file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • The export format can be explicitly specified in the form Export["file", expr, "MathML"] or Export.
  • See the reference pages for full general information on Import and Export.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties and settings
  • Data representation elements:
"Boxes"MathML typeset as a Mathematica box expression
"Expression"arbitrary Mathematica expression
"HeldExpression"unevaluated expression
"XMLObject"MathML as a symbolic XML expression
"XMLElement"nested XMLElement objects
"Annotations"{}which annotations to include
"Presentation"Truewhether to export MathML presentation elements
"Content"Falsewhether to export MathML content elements
  • The setting for is a list which may include any number of the choices , , and .
Exporting an arbitrary mathematical expression by default generates presentation MathML:
This creates combined presentation and content MathML:
This generates pure content MathML:
Define and display a Mathematica box expression:
Convert it to presentation MathML:
Convert the previous output to a box expression and display it:
Import automatically recognizes the MathML format:
Show the available Import elements:
Convert MathML to an evaluated expression:
Import MathML as a symbolic XML expression:
Exporting an arbitrary mathematical expression by default generates presentation MathML:
In[1]:=
Click for copyable input
Out[1]=
This creates combined presentation and content MathML:
In[2]:=
Click for copyable input
Out[2]=
This generates pure content MathML:
In[3]:=
Click for copyable input
Out[3]=
 
Define and display a Mathematica box expression:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]//DisplayForm=
Convert it to presentation MathML:
In[3]:=
Click for copyable input
Out[3]=
Convert the previous output to a box expression and display it:
In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]//DisplayForm=
Import automatically recognizes the MathML format:
In[6]:=
Click for copyable input
Out[6]=
Show the available Import elements:
In[7]:=
Click for copyable input
Out[7]=
Convert MathML to an evaluated expression:
In[8]:=
Click for copyable input
Out[8]=
Import MathML as a symbolic XML expression:
In[9]:=
Click for copyable input
Out[9]=