--
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 http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/7cd0ae38-1097-4f7b-b3f8-19780965a217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello.
Have you considered a text in a matplotlib graph ?
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/5469EF3C.60702%40verizon.net.
--
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 http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/faa755d6-1795-41c4-a523-f90092732537%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAP7f1AgRJceWP7-bCsJE1MJAQqa14Tm9upzEabCnGnjKfqDpcQ%40mail.gmail.com.
from IPython.display import Image, display
from IPython.lib.latextools import latex_to_png
eq = r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx'ValueError: \begin{bmatrix}\frac{1}{2 a} \left(- b + \sqrt{- 4 a c + b^{2}}\right), & - \frac{1}{2 a} \left(b + \sqrt{- 4 a c + b^{2}}\right)\end{bmatrix} ^ Unknown symbol: \begin (at char 0), (line:1, col:1)
There is another case where \left and \right cause errors without there being a matrix in the expression.
Thanks for all the replies:
Aaron Meurer:
I tried preview. It looks like a LaTeX installation is required and on this particular system I'm on, I am not allowed to install it - same with the other suggested package. Is there a workaround, perhaps directing the use of MathJax?
Jason Moore:
I looked at the source code you suggested and did some experimentation. It led me to:
http://stackoverflow.com/questions/24223695/python-spyder-display-symbolic-math
This is tantalizingly close to what I'd like. It works for some expressions such as the one in the SO example.eq = r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx'from IPython.display import Image, display from IPython.lib.latextools import latex_to_png
data = latex_to_png(eq, wrap=True)
display(Image(data=data))
Expressions involving the \left and \right operators return errors:
eq = r'\begin{bmatrix}\frac{1}{2 a} \left(- b + \sqrt{- 4 a c + b^{2}}\right), & - \frac{1}{2 a} \left(b + \sqrt{- 4 a c + b^{2}}\right)\end{bmatrix}'
...ValueError: \begin{bmatrix}\frac{1}{2 a} \left(- b + \sqrt{- 4 a c + b^{2}}\right), & - \frac{1}{2 a} \left(b + \sqrt{- 4 a c + b^{2}}\right)\end{bmatrix} ^ Unknown symbol: \begin (at char 0), (line:1, col:1)
There is another case where \left and \right cause errors without there being a matrix in the expression.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/49fdfb37-572d-4e41-89f8-59497568385f%40googlegroups.com.