OpenersNotesSection(Spacer1)Details

OpenersPrimaryExamplesSection(Spacer1)Examples  (6)

OpenersExampleSection0(Spacer1)Basic Examples  (6)

Interpret TeX inputs without evaluating them:

Interpreter["InactiveTeXExpression"]["2+2"]

Interpreter["InactiveTeXExpression"]["\\sin(\\pi)"]

No evaluation is attempted when matching the choices:

Interpreter[Restricted["InactiveTeXExpression",{{True, False}}]]["1=2"]

Interpreter[Restricted["InactiveTeXExpression",{{True, Inactivate[Equal[1,2]]}}]]["1=2"]

By default, all symbols are allowed. Restrict to a list of allowed symbols:

Interpreter[Restricted["InactiveTeXExpression",{Greater}]]["x>2"]

Interpreter[Restricted["InactiveTeXExpression",{Greater}]]["\\sin(x)>2"]

By default, new symbols are created in (RefLink[$Context, paclet:ref/$Context]), but a custom context can be specified:

var=Interpreter[Restricted["InactiveTeXExpression",Automatic,Automatic,Automatic]]["x"]
Context[Evaluate[var]]

var=Interpreter[Restricted["InactiveTeXExpression",Automatic,Automatic,"mycontext`"]]["x"]
Context[Evaluate[var]]

Specify contexts for the allowed and output symbols:

Global`y = 10;
Interpreter[Restricted["InactiveTeXExpression",Automatic,{"Global`","System`"},"Global`"]]["\\sin(y)"]

Prevent the creation of any new symbol:

Interpreter[Restricted["InactiveTeXExpression",Automatic,Automatic,None]]["\\sin(0)>0"]

Interpreter[Restricted["InactiveTeXExpression",Automatic,Automatic,None]]["\\sin(z)>0"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[TeXForm, paclet:ref/TeXForm])  ▪  (RefLink[Interpreter, paclet:ref/Interpreter])  ▪  (RefLink[Restricted, paclet:ref/Restricted])  ▪  (RefLink[Failure, paclet:ref/Failure])  ▪  (RefLink[Inactive, paclet:ref/Inactive])  ▪  (RefLink[Inactivate, paclet:ref/Inactivate])}, {Related Interpreter Types:  (RefLink[TeXExpression, paclet:ref/interpreter/TeXExpression])  ▪  (RefLink[HeldTeXExpression, paclet:ref/interpreter/HeldTeXExpression])  ▪  (RefLink[MathMLExpression, paclet:ref/interpreter/MathMLExpression])  ▪  (RefLink[HeldMathMLExpression, paclet:ref/interpreter/HeldMathMLExpression])  ▪  (RefLink[InactiveMathMLExpression, paclet:ref/interpreter/InactiveMathMLExpression])}, {Related Formats:  (RefLink[LaTeX, paclet:ref/format/LaTeX])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Setting Up Input Interpreters, paclet:guide/InterpretingStrings])}})}})