I am trying to import a $\LaTeX$ equation into Mathematica. I called ToExpression[expression,TeXForm]
, which works for the most part, but sometimes it interprets products as functions, and I don't see how to prevent this.
For instance, I have the following equation:
c_{1,2} (b c_{1,2} - a s_{1,2}) t_{1,2}
which Mathematica interprets as $c_{1,2}[b\,c_{1,2} - a\,s_{1,2}]\,t_{1,2}$, where the square brackets mean that Mathematica sees $c_{1,2}$ as a function instead of a variable. Rewriting the expression as:
(b c_{1,2} - a s_{1,2}) c_{1,2} t_{1,2}
gives the result I want, but I have a lot of quite long equations already written, and it would be very tedious to check and shuffle them by hand.
Am I missing something obvious? How can I avoid this behavior? Thanks!
Edit: thanks for everyone's input! It wasn't simple to decide which answer to accept, in the end I accepted Domen's answer because it didn't require to change any of the latex. But I'm sure your suggestions will come in handy in the future :)