I have read that $\LaTeX$ source can be directly pasted into a Mathematica notebook. However, I have been unsuccessful in this regard. An example of the errors received are:
$\frac{1}{2}$
Syntax::sntxb: Expression cannot begin with "$ frac{1}{2}$".
Syntax::tsntxi: "$ frac" is incomplete; more input is needed.
Syntax::sntxi: Incomplete expression; more input is needed .
This is not remediated by removal of the $
signs, placement of two $
signs ($$
), or use of other $\LaTeX$ math mode delimiters (e.g., \[ \]
, \begin{displaymath}\end{displaymath}
, \begin{equation}\end{equation}
, etc). I do not wish to import an entire .tex
file as I merely want to pass a few select equations. Please advise as to my error. Thank you.
Edit: I am using Mathematica 8.0.1.0.
Answer
I'm prompted by Mathematica when pasting (using 8.0.4) so I don't have this issue. The following seems to do the trick though..
ToExpression["\\frac{1}{2}", TeXForm]
I would expect others might have more illuminating responses to this.
EDIT:
The prompt I referred to is controlled via GlobalOptions > MessageOptions > TeXPasteWarning in the Options Inspector which can be found under Edit > Preferences > Advanced. If this is set to False
you won't get prompted as to how you would like to paste the input.
Comments
Post a Comment