MathMLForm[expr]
prints as a MathML form of expr.
MathMLForm
MathMLForm[expr]
prints as a MathML form of expr.
Details
- MathMLForm gives presentation MathML, although its output can normally be interpreted by the Wolfram Language.
- MathMLForm[expr] gives MathML for the TraditionalForm of expr. »
- MathMLForm[StandardForm[expr]] gives MathML for the StandardForm of expr. »
- When an input evaluates to MathMLForm[expr], MathMLForm does not appear in the output. »
- MathMLForm gives special characters using HTML aliases.
Examples
open all close allBasic Examples (2)
Scope (7)
Table[Panel[MathMLForm[f]], {f, {Subscript[x, a], x^a, Subsuperscript[x, a, b]}}]Table[Panel[MathMLForm[f]], {f, {Overscript[x, a], Underscript[x, a]}}]MathMLForm[{a, b, {c}}]Short[MathMLForm[(| | | |
| - | - | - |
| a | b | c |
| d | e | f |)], 4]MathMLForm[x∧y]MathMLForm[Sum[x ^ x, {x, 1, y}]]MathMLForm[Beta[z, a, b]]Generalizations & Extensions (1)
MathMLForm gives MathML for the TraditionalForm expression:
MathMLForm[Sin[x]]Obtain MathML for the expression in StandardForm:
MathMLForm[StandardForm[Sin[x]]]Properties & Relations (5)
Convert an expression to MathML:
ml = MathMLForm[x + Exp[y]]Use ToExpression to convert MathML back to Wolfram Language syntax:
ToExpression[ToString[ml], MathMLForm]Use ToExpression to convert from any MathML to the Wolfram Language:
ToExpression["<math><msup><mi>x</mi><mi>y</mi></msup></math>", MathMLForm]Use Export to generate a MathML document, including semantic markup:
ExportString[Sin[x], "MathML"]Add formatting via Format:
bin[x, y]//MathMLFormFormat[bin[x_, y_], MathMLForm] := MatrixForm[{{x}, {y}}]bin[x, y]//MathMLFormWhen an input evaluates to MathMLForm[expr], MathMLForm does not appear in the output:
MathMLForm[x ^ 2]Out is assigned the value x2, not MathMLForm[x^2]:
%Possible Issues (1)
Even when an output omits MathMLForm from the top level, it is not stripped from subexpressions:
e = MathMLForm[x ^ 2]The output does not have MathMLForm in it:
%However, the variable e does have MathMLForm in it, which may affect subsequent evaluations:
FullForm[e]The product is not evaluated due to the intervening MathMLForm:
x * eAssign variables first and then apply MathMLForm to the result to maintain computability:
(f = x ^ 2)//MathMLFormx * fTech Notes
Related Guides
Related Workflows
- Reformat an Expression in TraditionalForm
History
Introduced in 2000 (4.1)
Text
Wolfram Research (2000), MathMLForm, Wolfram Language function, https://reference.wolfram.com/language/ref/MathMLForm.html.
CMS
Wolfram Language. 2000. "MathMLForm." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MathMLForm.html.
APA
Wolfram Language. (2000). MathMLForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MathMLForm.html
BibTeX
@misc{reference.wolfram_2026_mathmlform, author="Wolfram Research", title="{MathMLForm}", year="2000", howpublished="\url{https://reference.wolfram.com/language/ref/MathMLForm.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mathmlform, organization={Wolfram Research}, title={MathMLForm}, year={2000}, url={https://reference.wolfram.com/language/ref/MathMLForm.html}, note=[Accessed: 13-June-2026]}