Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible for SymPy to render LaTeX for use in a GUI?

I am hoping to use PyQt to produce an application that will display an equation entered by the user. I had considered matplotlib, but this seems like overkill as I would only be using it to render the latex.

I need to use SymPy anyway, so I was hoping there would be a way to use it to do the rendering also, preferably producing an SVG file for PyQt to use.

I hope this makes sense - many thanks in advance for any help/advice.

Best wishes, Geddes

like image 654
Geddes Avatar asked Oct 10 '10 20:10

Geddes


2 Answers

If you just need simple rendering using python, how about trying ipython 0.11 with qtconsole using sympy profile(ipython qtconsole --profile=sympy). It did implement matplotlib, but I consider it quite clean considering mathematical expressions can be rendered directly on the qtconsole. Need to install pyzmq module.

like image 186
Boyi Avatar answered Oct 16 '22 04:10

Boyi


You could output MathML using SymPy and then use SVGMath to convert it to SVG.

like image 31
Mad Scientist Avatar answered Oct 16 '22 04:10

Mad Scientist