MathGroup Archive 2009

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

Search the Archive

ToExpression[..,TexForm] does not seem to work on some Latex commands?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104351] ToExpression[..,TexForm] does not seem to work on some Latex commands?
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Thu, 29 Oct 2009 02:54:30 -0500 (EST)
  • Reply-to: "Nasser M. Abbasi" <nma at 12000.org>

 Version 7.

Some Latex commands are converted ok to Mathematica expressions, such as:

ToExpression["\\sqrt{3}", TeXForm]
ToExpression["\\frac{a}{b}", TeXForm]

But the next Latex "sum" command does not seem to work. Is this a known 
"issue" or is there a trick for one command?

I take the output of the TexForm command, and then try to convert it back to 
Mathematica expression, but the conversion back fails:

s = TeXForm[Sum[f[n], {n, 1, m}]]
ToExpression[ToString[s], TeXForm]

Even when I type the Latex output by hand, it does not work:

ToExpression["\\sum_{n=1}^m f(n)", TeXForm]

the error is :

Syntax::sntxi:Incomplete expression; more input is needed.
ToExpression::esntx:Could not parse \sum_{n=1}^m f(n) as Mathematica input.

--Nasser 



  • Prev by Date: Re: problem of syntax.
  • Next by Date: Re: ReplaceAll and rules from a list v7.0
  • Previous by thread: Plot3d causes crash with radeon driver and Debian testing
  • Next by thread: Re: ToExpression[..,TexForm] does not seem to work on some Latex commands?