Re: Latex and \sum
- To: mathgroup at smc.vnet.net
- Subject: [mg77072] Re: Latex and \sum
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sat, 2 Jun 2007 04:23:20 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <f3of1o$ong$1@smc.vnet.net>
Martin Grossman wrote: > Hi there, > > In Mathematica 6 I am having trouble using command > ToExpression["input", TeXForm]. > I want to use LaTex sign sum : \sum > When I used ToExpression["\\sum _{i=a}^b x_i",TeXForm] it doesnt work. > Other symbols like \frac{}{} work... Any solution? > > Thanks > martin grossman > The issue, though that does not solve the problem, seems to be related to the way Mathematica parses the "i=a" part. In[1]:= ToExpression["\\sum_{i}^b x_i", TeXForm] Out[1]= Sum[Subscript[x, i], {i, 1, b}] In[2]:= ToExpression["\\sum_{i=1}^b x_i", TeXForm] During evaluation of In[2]:= ToExpression::esntx:Could not parse \ \sum_{i=1}^b x_i as Mathematica input. Out[2]= $Failed In[3]:= ToExpression["\\sum_{a}^b x_i", TeXForm] Out[3]= b*Subscript[x, i] In[4]:= ToExpression[ToString[\sum _ {n = 1}^m n^2], TeXForm] During evaluation of In[4]:= ToExpression::esntx:Could not parse \sum \ _{n=1}^m n^2 as Mathematica input. Out[4]= $Failed In[5]:= ToExpression[ ToString[\frac {(x + y)^2} {\sqrt {x y}}], TeXForm] Out[5]= (x + y)^2/Sqrt[xy] Regards, Jean-Marc