What SymPy Live does is return the LaTeX string of expression using the LaTeX printer (accessible through the latex() function), and then passes that to MathJax, which converts it to a printed expression. Any string output is passed to MathJax, so even if you just enter a string, it will be parsed as LaTeX.
If you want to know how the LaTeX printer works, see sympy/printing/latex.py. Aaron Meurer On Fri, May 25, 2012 at 10:36 AM, Matthew Rocklin <[email protected]> wrote: > Hi Duncan, > > To the best of my knowledge SymPy is unable to parse LaTeX. We are however > able to generate it; this is what you're seeing on live.sympy.org. > > You can look at our latex printing by downloading our source and checking > out the sympy/sympy/printing/latex.py file. > > I think it would be awesome to have a latex parser for SymPy. This might be > challenging though. > > -Matt > > > On Fri, May 25, 2012 at 11:19 AM, Duncan Steele > <[email protected]> wrote: >> >> Hello, I am new to sympy, and I am really impressed by the web demo at >> live.sympy.org. I am trying to replicate that shell's ability to >> understand latex maths notation, and I have been unsuccessful. I have >> combed through both sympy and sympy-live without understanding how >> live.sympy.org parses latex maths. >> >> There seems to be some API function that the web shell calls to parse >> the string I type in, e.g. 'X = \sum_i x_i = X '. What is it? >> >> Thanks, >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/sympy?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
