Inconsistancies in math formula display (ipython console)
See original GitHub issueProblem Description
Hi, Displaying math formula as png in the console provides ‘random’ output. Whereas the same works fine in a jupyter notebook. I’ve already asked sympy (sympy/sympy#20491), but I guess it is a spyder issue as it works in a notebook?
What steps reproduce the problem?
eg (in the spyder IPython console):
import sympy as sp
sp.var(x)
x*x
Ok fine, now:
Switch to pretty print mode (no image)!
Another example (from IPython doc)
from IPython.display import Math
Math(r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx')
Out[1]:
<IPython.core.display.Math object>
While in a ‘pure’ notebook:
Versions
Anaconda 3 (updated) spyder 4.1.5
Hope this helps, thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How to fix the display issues with Pretty-Printing of symbolic ...
All we need to do is, go to Preferences-> IPython Console-> Advanced settings-> check use symbolic math. If you want to set a...
Read more >Can Python/IPython display "pretty math"? - Reddit
Yes, the notebook and qtconsole both have support for latex. SymPy does symbolic calculations like Maple or Wolfram, and it shows it all...
Read more >Latex equations not rendered in Jupyterlab
I am using jupyter lab on my MacOS with following details; jupyter core : 4.6.3 jupyter-notebook : 6.1.4 qtconsole : 4.7.7 ipython :...
Read more >LaTeX/Mathematics - Wikibooks, open books for an open world
Typesetting mathematics is one of LaTeX's greatest strengths. It is also a large topic due to the existence of so much mathematical notation....
Read more >Representing Rational Numbers With Python Fractions
Numbers with infinite decimal expansions cause rounding errors when ... from fractions import Fraction from IPython.display import display, Math Fraction.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, for getting the expected result you need to:
Consoles > New special console > New Sympy console
If you don’t want to use the Sympy console, then you need to read the following documentation to make it work, https://docs.sympy.org/latest/modules/interactive.html?highlight=init_printing#sympy.interactive.printing.init_printing
Please let me know if it works for you
No worries @sylvain-bougnoux.
I forgot to mention that next year we plan to add a new Viewer pane to visualize web content directly inside Spyder. Then we’ll be able to display Sympy objects exactly as it’s done in a Jupyter notebook.