Please help me with the following problem:
TeXForm[2/3]
The Answer is correct:
"\frac{2}{3}"
I don't understand why Mathematica gives me a wrong inverse:
ToExpression["\frac{2}{3}", TeXForm]
The Answer is:
23 a c r
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 should escape "\" by second "\"
ToExpression["\\frac{2}{3}", TeXForm]
To avoid this problem, produce strings explicitly. Copy-pasted text from the TeXForm
is designed for an external TeX editor
ToString[2/3, TeXForm]
(* "\\frac{2}{3}" *)
ToExpression["\\frac{2}{3}", TeXForm]
$\endgroup$