-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sympy Latex rendering behavior and fallback logic #21583
Comments
Hi @cr941131 thank you for the feedback! Do you have LaTeX installed on your machine (via TextLive, MikTex or some other distribution)? Since the IPython console inside Spyder is an "embeded" QtConsole, I think if you don't have LaTeX installed Sympy fallbacks to render things using matplotlib if available, if it's not available then fallbacks to use the Unicode pretty printer. For more info about Sympy printing you can check: https://docs.sympy.org/latest/tutorials/intro-tutorial/printing.html Let us know if the info above helps! |
Thank you for your response. I usually use However, recently, when I tried to render LaTeX with Obsidian:Jupyter notebook:VScode:SpyderORpython codefrom sympy import *
from IPython.display import display
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
# init_printing()
a = Integral(cos(x)*exp(x), x)
eq1 = Eq(a, a.doit())
display(a)
display(eq1)
print(latex(a)) |
Yep, that makes sense. I would say that the rendering works over Obsidian, VSCode and Jupyter notebooks since they use web based technologies and they can use for rendering things like MathJax. Also, just in case, I did a quick test of installing MikTex and I was able to see LaTex rendering: So basically if you want to see LaTex rendering from the Spyder IPython console you need to install some LaTex distribution. For more info about the fallback behavior Sympy uses you can check this OS post: https://stackoverflow.com/a/43924252/15954282 I think there is not much from the Spyder side we can do but let us know if the info above helps! |
@metagross4, when you run A workaround to avoid that is to change Then you'll get the latex version of your symbol. |
@ccordoba12 Thank you for replying, it worked! |
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
When I try to use Spyder to render LaTeX, in the IPython console, it's not rendered in a nice font, but rather in a bold typeface. However, on the contrary, when I use Jupyter Notebook, which is also installed via Anaconda, it renders normally
What steps reproduce the problem?
What is the expected output? What do you see instead?
Paste Traceback/Error Below (if applicable)
Versions
Dependencies
The text was updated successfully, but these errors were encountered: