I am having trouble entering equations in TeX form. I have actually tried a bunch of different equations and gotten similar errors. For example:
ToExpression["\\int_0^\\infty e^{-x^2} dx = \\frac{\\sqrt\\pi}2",TeXForm]
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityYou can get your equation in unevaluated form using
ToExpression["\\int_0^\\infty E^{-x^2}\\,dx = \\frac{\\sqrt\\pi}2", TeXForm, HoldForm]
which wraps the expression in HoldForm
before evaluation. Note the thin space before dx
, which is needed for Mathematica to properly interpret the integral syntax, and the capital E
.
ToExpression["{HoldForm}[\\int_0^\\infty E^{-x^2}\\,dx = \\frac{\\sqrt\\pi}2]", TeXForm]
also works to get the held form.
dx
:ToExpression["\\int_0^\\infty e^{-x^2}\\,dx = \\frac{\\sqrt\\pi}2",TeXForm]
. $\endgroup$e
interpreted as an arbitrary variable. Change thee
toE
and Mathematica will verify your equation. $\endgroup$