latex parse "e"

53 views
Skip to first unread message

subharmony

unread,
Oct 8, 2020, 6:06:57 PM10/8/20
to sympy
I am trying to use parse_latex to convert e^x into a sympy expression. However, 'e' is interpreted as a free symbol rather than a special character. Is there a way to indicate that 'e' should be interpreted as exp()?

thank you

Aaron Meurer

unread,
Oct 8, 2020, 6:09:16 PM10/8/20
to sympy
I would consider this to be a bug in the LaTeX parser. Can you open
an issue for it?

Currently, the latex parser doesn't have very many options. We are
hoping to improve it. For now, though, you can work around this by
manually doing result = result.subs(Symbol('e'), E).

Aaron Meurer

On Thu, Oct 8, 2020 at 4:06 PM subharmony <subha...@gmail.com> wrote:
>
> I am trying to use parse_latex to convert e^x into a sympy expression. However, 'e' is interpreted as a free symbol rather than a special character. Is there a way to indicate that 'e' should be interpreted as exp()?
>
> thank you
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/sympy/eddbfbce-959b-486f-b14a-3a068a3b5875n%40googlegroups.com.

subharmony

unread,
Oct 20, 2020, 5:42:31 PM10/20/20
to sympy
Thank you for your reply and help with the work around. I have found a similar problem for interpreting 'pi' and have opened an issue that describes both cases.

cheers

Reply all
Reply to author
Forward
0 new messages