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