MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: LaTex to Mathematica

snowrain wrote:

> Does anyone know how to convert LaTex file to Mathematica ? 
> For example, the formula that I typed in LaTex is:  
> ln{H}^{*} &=  {X}_{1} {\beta}_{1}  + {\alpha}_{1}lnE+ {\varepsilon}_{1}\\
> If I copy the above LaTex command to Mathematica, it only shows the
> original LaTex command. I'd like to have symbols for beta, alpha, and also
> for subscript and superscript. That is, I hope it looks like the pdf file
> that LaTex produces instead of showing "\beta", "\alpha", etc. 

First, note that Mathematica handles AMS-LaTeX. Depending on how the 
code you have adheres to this standard, you will get varying results 
with the automatic conversion process.

Converting a LaTeX file can be done via the command *Import* [1], e.g.


If you want to convert just one expression in TeX/LaTeX, you can use use 
ToExpression with the option TeXForm [2, 3].

Note that the expression must be enclosed within double quotes, must 
start and end with a dollar sign, and backlashes must be repeated.

In[12]:= ToExpression["$ln{H}^{*}&={X}_{1}
{\\beta}_{1}+{\\alpha}_{1}lnE+{\\varepsilon}_{1}\\\\$", TeXForm]

Out[12]= l n
\!\(\*SuperscriptBox["H", "*"]\) ==
  E l n Subscript[\[Alpha], 1] +
   Subscript[X, 1] Subscript[\[Beta], 1] + Subscript[\[Epsilon], 1]

- Jean-Marc




  • Prev by Date: Re: Graphing Difference Equation
  • Next by Date: Re: Mathematica and Jaws
  • Previous by thread: Re: LaTex to Mathematica
  • Next by thread: Re: LaTex to Mathematica