how to convert latex expression into sympy expression?

1,050 views
Skip to first unread message

8216...@qq.com

unread,
Jun 14, 2017, 1:11:45 AM6/14/17
to sympy
I have a lot of latex expression, such as:
a+b+c=0
abc>0
\frac{1}{a}+\frac{1}{b}+\frac{1}{c}
\left({a+b+c}\right)^2=a^2+b^2+c^2+2ab+2bc+2ac=0

I want a function, let's say latex2sympy(latex), to convert latex to sympy expression?

how can i do that?

Christophe BAL (via GMAIL)

unread,
Jun 14, 2017, 3:22:14 AM6/14/17
to sy...@googlegroups.com

Hello.

Because LaTeX is not mathmetically semantic, you can't have a perfect converter from LaTeX to SymPy.

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/5f86b9c7-1ace-410c-aeb7-c57f505c42ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Christophe BAL
Enseignant Agrégé de Mathématiques
Programmeur Python Amateur

Jason Moore

unread,
Jun 14, 2017, 6:24:25 PM6/14/17
to sy...@googlegroups.com
On Wed, Jun 14, 2017 at 12:22 AM, Christophe BAL (via GMAIL) <proj...@gmail.com> wrote:

Hello.

Because LaTeX is not mathmetically semantic, you can't have a perfect converter from LaTeX to SymPy.




Le 14/06/2017 à 06:09, 8216...@qq.com a écrit :
I have a lot of latex expression, such as:
a+b+c=0
abc>0
\frac{1}{a}+\frac{1}{b}+\frac{1}{c}
\left({a+b+c}\right)^2=a^2+b^2+c^2+2ab+2bc+2ac=0

I want a function, let's say latex2sympy(latex), to convert latex to sympy expression?

how can i do that?
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@googlegroups.com.

To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/5f86b9c7-1ace-410c-aeb7-c57f505c42ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- 
Christophe BAL
Enseignant Agrégé de Mathématiques
Programmeur Python Amateur

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@googlegroups.com.

To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.

Richard Fateman

unread,
Jun 22, 2017, 3:59:08 PM6/22/17
to sympy
see, for example,

for a discussion.  It is really a consideration of "optical character recognition"
of math equations, where the characters are mostly perfectly represented,
and the spacing is perfectly represented.  But what is the meaning of, say,
a superscript?  

To find info, consider that google is your friend.
RJF


On Wednesday, June 14, 2017 at 3:24:25 PM UTC-7, Jason Moore wrote:
On Wed, Jun 14, 2017 at 12:22 AM, Christophe BAL (via GMAIL) <proj...@gmail.com> wrote:

Hello.

Because LaTeX is not mathmetically semantic, you can't have a perfect converter from LaTeX to SymPy.




Le 14/06/2017 à 06:09, 8216...@qq.com a écrit :
I have a lot of latex expression, such as:
a+b+c=0
abc>0
\frac{1}{a}+\frac{1}{b}+\frac{1}{c}
\left({a+b+c}\right)^2=a^2+b^2+c^2+2ab+2bc+2ac=0

I want a function, let's say latex2sympy(latex), to convert latex to sympy expression?

how can i do that?
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.

To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/5f86b9c7-1ace-410c-aeb7-c57f505c42ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- 
Christophe BAL
Enseignant Agrégé de Mathématiques
Programmeur Python Amateur

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.

To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
Reply all
Reply to author
Forward
0 new messages