"InactiveMathMLExpression" (Interpreter Type)
"InactiveMathMLExpression" (Interpreter Type)
MathML input.
Details
- "InactiveMathMLExpression" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "InactiveMathMLExpression" does not require connectivity to the Wolfram Cloud.
- "InactiveMathMLExpression" keeps its result unevaluated by wrapping it in HoldComplete.
Restriction Specifications
-
Restricted["InactiveMathMLExpression",{{choice1,…}}] one among choices Restricted["InactiveMathMLExpression",symbols] a MathML expression involving only the given symbols (All, Automatic, or an explicit list) Restricted["InactiveMathMLExpression",symbols,contexts] a MathML expression involving only the given symbols or symbols in the given contexts (All, Automatic, or an explicit list) Restricted["InactiveMathMLExpression",symbols,contexts,resultcontext] a MathML expression involving only the given symbols or symbols in the given contexts, where the new symbols are created in resultcontext
Interpretation
- "InactiveMathMLExpression" yields an Inactive representation of the
expression in the Wolfram Language.
Examples
Basic Examples (6)
Interpret MathML inputs without evaluating them:
Interpreter["InactiveMathMLExpression"]["<math><mrow><mn>2</mn><mo>+</mo><mn>2</mn></mrow></math>"]Interpreter["InactiveMathMLExpression"]["<math><mrow><mi>sin</mi><mo>⁡</mo><mo>(</mo><mi>0</mi><mo>)</mo></mrow></math>"]No evaluation is attempted when matching the choices:
Interpreter[Restricted["InactiveMathMLExpression", {{True, False}}]]["<math><mrow><mn>2</mn><mo>==</mo><mn>2</mn></mrow></math>"]Interpreter[Restricted["InactiveMathMLExpression", {{Inactivate[Equal[2, 2]], False}}]]["<math><mrow><mn>2</mn><mo>==</mo><mn>2</mn></mrow></math>"]By default, all symbols are allowed. Restrict to a list of allowed symbols:
Interpreter[Restricted["InactiveMathMLExpression", {Plus}]]["<math><mrow><mn>2</mn><mo>+</mo><mn>2</mn></mrow></math>"]Interpreter[Restricted["InactiveMathMLExpression", {Plus}]]["<math><mrow><mn>2</mn><mo>*</mo><mn>2</mn></mrow></math>"]By default, new symbols are created in $Context, but a custom context can be specified:
Interpreter[Restricted["InactiveMathMLExpression", Automatic, Automatic, Automatic]]["<math><mrow><mn>x</mn></mrow></math>"]
Context[x]Interpreter[Restricted["InactiveMathMLExpression", Automatic, Automatic, "mycontext`"]]["<math><mrow><mn>y</mn></mrow></math>"]
Context[x]Specify contexts for the allowed and output symbols:
Global`z = 10;
Interpreter[Restricted["InactiveMathMLExpression", Automatic, {"Global`", "System`"}, "Global`"]]["<math><mrow><mi>sin</mi><mo>⁡</mo><mo>(</mo><mi>z</mi><mo>)</mo></mrow></math>"]Prevent the creation of any new symbol:
Interpreter[Restricted["InactiveMathMLExpression", Automatic, Automatic, None]]["<math><mrow><mn>2</mn><mo>+</mo><mn>2</mn></mrow></math>"]Interpreter[Restricted["InactiveMathMLExpression", Automatic, Automatic, None]]["<math><mrow><mn>z</mn><mo>+</mo><mn>2</mn></mrow></math>"]See Also
Interpreter Restricted Failure Inactive Inactivate
Interpreter Types: MathMLExpression HeldMathMLExpression TeXExpression HeldTeXExpression InactiveTeXExpression
Related Guides
History
Introduced in 2016 (10.4)