Discussion:
ToExpression[..,TexForm] does not seem to work on some Latex commands?
(too old to reply)
Nasser M. Abbasi
2009-10-29 08:11:01 UTC
Permalink
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
Nasser M. Abbasi
2009-10-30 07:18:51 UTC
Permalink
Thanks, I can then only assume that this was a bug in version 7.0.0 and it
was fixed in 7.0.1

my system says:

"7.0 for Microsoft Windows (32-bit) (November 10, 2008)"

rant about version numbers follows:

Interesting that $Version prints 7.0 on my system like it does on yours
below, but the date is different, mine says nov 10 2008 and yours says
"February 19, 2009".

I assume then you knew, somehow, from the date shown on your end that this
is 7.0.1? It would have been nice if the version number would also have
changed/updated to reflect this and not just the date!

I noticed for sometime that WRI have something about showing version
numbers, it is almost impossible to find what version numbers some of their
products are at for some reason.

For example, I spent sometime the other day trying to find exactly what
version number is the current Mathematica at, and I could not.

I think it is 7.0.2, or 7.2.0, but I am guessing as there is no place on
WRI web site which says anything about this.

If any one knows where to find this info, please let me know, as I'd like to
keep my Mathematica version number page correct here

http://12000.org/my_notes/compare_mathematica/index.htm


--Nasser

----- Original Message -----
From: "Bob Hanlon" <***@cox.net>
To: "Nasser M. Abbasi" <***@12000.org>; <***@smc.vnet.net>
Sent: Thursday, October 29, 2009 7:33 PM
Subject: Re: ToExpression[..,TexForm] does not seem to work on
some Latex commands?
I have version 7.0.1
$Version
7.0 for Mac OS X x86 (64-bit) (February 19, 2009)
s = TeXForm[Sum[f[n], {n, 1, m}]]
\sum _{n=1}^m f(n)
ToExpression["\\sum _{n=1}^m f(n)", TeXForm]
Sum[f[n], {n, 1, m}]
Bob Hanlon
=============
From: "Bob Hanlon"
Put a space after sum in the TeX
s = TeXForm[Sum[f[n], {n, 1, m}]]
\sum _{n=1}^m f(n)
Note the space after sum in the above output
ToExpression["\\sum _{n=1}^m f(n)", TeXForm]
Sum[f[n], {n, 1, m}]
ToExpression["\\sum _ {n=1}^m f(n)", TeXForm]
Sum[f[n], {n, 1, m}]
Bob Hanlon
hello;
I did.
With or without space, I get the same error. Which version you used? I am
using version 7
In[1]:= ToExpression["\\sum _{n=1}^m f(n)", TeXForm]
During evaluation of In[1]:= ToExpression::esntx:Could not parse \sum
_{n=1}^m f(n) as Mathematica input.
Out[1]= $Failed
Thanks
--Nasser
Nasser M. Abbasi
2009-10-30 07:19:45 UTC
Permalink
From: "Bob Hanlon"
Put a space after sum in the TeX
s = TeXForm[Sum[f[n], {n, 1, m}]]
\sum _{n=1}^m f(n)
Note the space after sum in the above output
ToExpression["\\sum _{n=1}^m f(n)", TeXForm]
Sum[f[n], {n, 1, m}]
ToExpression["\\sum _ {n=1}^m f(n)", TeXForm]
Sum[f[n], {n, 1, m}]
Bob Hanlon
hello;

I did.

With or without space, I get the same error. Which version you used? I am
using version 7

In[1]:= ToExpression["\\sum _{n=1}^m f(n)", TeXForm]
During evaluation of In[1]:= ToExpression::esntx:Could not parse \sum
_{n=1}^m f(n) as Mathematica input.
Out[1]= $Failed

Thanks
--Nasser
Nasser M. Abbasi
2009-10-31 06:53:58 UTC
Permalink
For people with Mathematica, simply do Help > About Mathematica, and up
comes the information box.
For those interested in teh current status, here is the relevant URL.
http://www.wolfram.com/products/mathematica/latestversion/
Current version is 7.0.1. To find this on our site took a bit of doing (I
mean, I knew the answer, but wanted to figure out how someone outside
Wolfram Research could get this information).
Start at the main site www.wolfram.com. Click on PRODUCTS (upper left). At
this point I had to go to Quick Links near bottom left, "Select from the
list". This gave an option "Mathematica Version Information". I selected
that and hit "Go". It brought me to the location whose URL is indicated
above.
Daniel Lichtblau
Wolfram Research
Thanks, but there is a bit of confusion here, and I think the page could be
better designed.

When one points the mouse on "Products", which is what one normally does,
one gets a list, then selects Mathematica from the list. This is what you'd
expect one to do, right? Select a product from a list that comes up? not
"click" on products itself, but click on the item that comes up from the
list. When doing this, this is the cycle ones gets into

1. go to www.wolfram.com
2. mouse over products, menu comes up, look at menu, and click Mathematica
3. Mathematica page comes up (nothing here about current version number if
different), only version 7 it says.
3. at the bottom of the page there is "Mathematica product family" with a
little arrow >>> at the end meaning more, so I clicked in that just to see
what is there.
4. Nothing in this page about the version number. At the bottom page there
is a quick links menu telling me "What are you looking for?", Now, I am
looking for Mathemtica product version number, but I was on the Mathematica
product page to start from? ok
5. When I click on quick links, the first item that comes up is Mathematica,
and that is what I am looking form, and that is what caught my eyes, so I
click on that, only to find I am back on the same page I was in step 3
above.

So you can see how a customer would find it hard to find such a simple
thing?

You'd think the version number should be on the same page as the Mathematica
product itself, after all, it says "7" in big letters on the Mathematica
page. If the version is 7.0.1, then why does it says "7" there? and then it
says "7.0.1" somewhere else?

But thanks for the info, may be a bit of design improvement could be done
there. WRI pages are excellent pages, but nothing is perfect, I know.

--Nasser
Nasser M. Abbasi
2009-10-31 07:30:28 UTC
Permalink
For people with Mathematica, simply do Help > About Mathematica, and up
comes the information box.
For those interested in teh current status, here is the relevant URL.
http://www.wolfram.com/products/mathematica/latestversion/
Current version is 7.0.1. To find this on our site took a bit of doing (I
mean, I knew the answer, but wanted to figure out how someone outside
Wolfram Research could get this information).
Start at the main site www.wolfram.com. Click on PRODUCTS (upper left). At
this point I had to go to Quick Links near bottom left, "Select from the
list". This gave an option "Mathematica Version Information". I selected
that and hit "Go". It brought me to the location whose URL is indicated
above.
Daniel Lichtblau
Wolfram Research
Thanks, but there is a bit of confusion here, and I think the page could be
better designed.

When one points the mouse on "Products", which is what one normally does,
one gets a list, then selects Mathematica from the list. This is what you'd
expect one to do, right? Select a product from a list that comes up? not
"click" on products itself, but click on the item that comes up from the
list. When doing this, this is the cycle ones gets into

1. go to www.wolfram.com
2. mouse over products, menu comes up, look at menu, and click Mathematica
3. Mathematica page comes up (nothing here about current version number if
different), only version 7 it says.
3. at the bottom of the page there is "Mathematica product family" with a
little arrow >>> at the end meaning more, so I clicked in that just to see
what is there.
4. Nothing in this page about the version number. At the bottom page there
is a quick links menu telling me "What are you looking for?", Now, I am
looking for Mathemtica product version number, but I was on the Mathematica
product page to start from? ok
5. When I click on quick links, the first item that comes up is Mathematica,
and that is what I am looking form, and that is what caught my eyes, so I
click on that, only to find I am back on the same page I was in step 3
above.

So you can see how a customer would find it hard to find such a simple
thing?

You'd think the version number should be on the same page as the Mathematica
product itself, after all, it says "7" in big letters on the Mathematica
page. If the version is 7.0.1, then why does it says "7" there? and then it
says "7.0.1" somewhere else?

But thanks for the info, may be a bit of design improvement could be done
there. WRI pages are excellent pages, but nothing is perfect, I know.

--Nasser
Daniel Lichtblau
2009-10-31 07:39:52 UTC
Permalink
Post by Nasser M. Abbasi
Thanks, I can then only assume that this was a bug in version 7.0.0 and it
was fixed in 7.0.1
"7.0 for Microsoft Windows (32-bit) (November 10, 2008)"
Interesting that $Version prints 7.0 on my system like it does on yours
below, but the date is different, mine says nov 10 2008 and yours says
"February 19, 2009".
I assume then you knew, somehow, from the date shown on your end that this
is 7.0.1? It would have been nice if the version number would also have
changed/updated to reflect this and not just the date!
I noticed for sometime that WRI have something about showing version
numbers, it is almost impossible to find what version numbers some of their
products are at for some reason.
For example, I spent sometime the other day trying to find exactly what
version number is the current Mathematica at, and I could not.
I think it is 7.0.2, or 7.2.0, but I am guessing as there is no place on
WRI web site which says anything about this.
If any one knows where to find this info, please let me know, as I'd like to
keep my Mathematica version number page correct here
http://12000.org/my_notes/compare_mathematica/index.htm
--Nasser
----- Original Message -----
Sent: Thursday, October 29, 2009 7:33 PM
Subject: Re: ToExpression[..,TexForm] does not seem to work on
some Latex commands?
I have version 7.0.1
$Version
7.0 for Mac OS X x86 (64-bit) (February 19, 2009)
s = TeXForm[Sum[f[n], {n, 1, m}]]
\sum _{n=1}^m f(n)
ToExpression["\\sum _{n=1}^m f(n)", TeXForm]
Sum[f[n], {n, 1, m}]
Bob Hanlon
=============
From: "Bob Hanlon"
Put a space after sum in the TeX
s = TeXForm[Sum[f[n], {n, 1, m}]]
\sum _{n=1}^m f(n)
Note the space after sum in the above output
ToExpression["\\sum _{n=1}^m f(n)", TeXForm]
Sum[f[n], {n, 1, m}]
ToExpression["\\sum _ {n=1}^m f(n)", TeXForm]
Sum[f[n], {n, 1, m}]
Bob Hanlon
hello;
I did.
With or without space, I get the same error. Which version you used? I am
using version 7
In[1]:= ToExpression["\\sum _{n=1}^m f(n)", TeXForm]
During evaluation of In[1]:= ToExpression::esntx:Could not parse \sum
_{n=1}^m f(n) as Mathematica input.
Out[1]= $Failed
Thanks
--Nasser
For people with Mathematica, simply do Help > About Mathematica, and up
comes the information box.

For those interested in teh current status, here is the relevant URL.

http://www.wolfram.com/products/mathematica/latestversion/

Current version is 7.0.1. To find this on our site took a bit of doing
(I mean, I knew the answer, but wanted to figure out how someone outside
Wolfram Research could get this information).

Start at the main site www.wolfram.com. Click on PRODUCTS (upper left).
At this point I had to go to Quick Links near bottom left, "Select from
the list". This gave an option "Mathematica Version Information". I
selected that and hit "Go". It brought me to the location whose URL is
indicated above.

Daniel Lichtblau
Wolfram Research

Loading...