Re: LaTex to Mathematica

• To: mathgroup at smc.vnet.net
• Subject: [mg91413] Re: LaTex to Mathematica
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Wed, 20 Aug 2008 06:23:44 -0400 (EDT)
• Organization: The Open University, Milton Keynes, UK
• References: <g8gj47$etf$1@smc.vnet.net>

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* , e.g.

Import["filename.tex"]

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:= ToExpression["$ln{H}^{*}&={X}_{1} {\\beta}_{1}+{\\alpha}_{1}lnE+{\\varepsilon}_{1}\\\\$", TeXForm]

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

Regards,
- Jean-Marc

 http://reference.wolfram.com/mathematica/ref/format/LaTeX.html

 http://reference.wolfram.com/mathematica/ref/TeXForm.html

 http://reference.wolfram.com/mathematica/ref/ToExpression.html



• 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
{"ft_lang_label":"__label__en","ft_lang_prob":0.6954183,"math_prob":0.52063864,"size":1791,"snap":"2019-26-2019-30","text_gpt3_token_len":541,"char_repetition_ratio":0.11359821,"word_repetition_ratio":0.0,"special_character_ratio":0.307091,"punctuation_ratio":0.18457301,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99858165,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-06-25T12:57:42Z\",\"WARC-Record-ID\":\"<urn:uuid:b5579107-ea83-47a8-abc8-6ab38da30424>\",\"Content-Length\":\"43081\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7ba4627b-7304-4812-9821-75f11e5e9675>\",\"WARC-Concurrent-To\":\"<urn:uuid:6da7ea29-dcad-4b7a-858a-82dc2758f5e4>\",\"WARC-IP-Address\":\"140.177.205.73\",\"WARC-Target-URI\":\"http://forums.wolfram.com/mathgroup/archive/2008/Aug/msg00450.html\",\"WARC-Payload-Digest\":\"sha1:TFB35T2WWEVCB7VFECRVCGNJSFEDEMUR\",\"WARC-Block-Digest\":\"sha1:GOD2QLARKIFZL3HB2ZOS6CGXE4ADO3KR\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-26/CC-MAIN-2019-26_segments_1560627999838.23_warc_CC-MAIN-20190625112522-20190625134522-00022.warc.gz\"}"}