question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LaTeX Render wrong - Sympy init_printing

See original GitHub issue

Bug: Notebook Editor, trying to print using LaTeX

While using sympy in jupyter notebook in vscode, the output of the cell is not using the right “printer”… Very similar to issue #8742 but it is closed and I can’t post there.

Steps to cause the bug to occur

  1. Open a jupyter notebook
  2. write the following code:
from sympy import * 
init_printing(use_latex=True) # Tried the following as well: init_printing(use_latex="mathjax", latex_mode="equation")
var('x,y')
y = expand((x+y)**2)
y

3.run cell and see output

Actual behavior

image

Expected behavior

image (ran the exact same code in jupyter lab)

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: v2020.9.112786
  • VS Code version: 1.49.2
  • Setting python.languageServer: Jedi
  • Python and Anaconda version: Python 3.8.5 / Conda 4.8.5
  • OS: Linux (distro): Pop!_OS 20.04 LTS
  • Virtual environment: conda

Python Output

Info 2020-10-01 19:57:03: Python Daemon (pid: 43128): Kernel launched, with PID as a daemon 43132 Info 2020-10-01 19:57:27: Executing cell NotebookImport#14 Info 2020-10-01 19:57:27: Waiting for jupyter server and web panel … Info 2020-10-01 19:57:27: Submitting code for 5b1a5571-8966-4a8a-a521-785d3da07608 Info 2020-10-01 19:57:27: Kernel switching to busy Info 2020-10-01 19:57:27: Kernel switching to idle Info 2020-10-01 19:57:27: Kernel switching to busy Info 2020-10-01 19:57:30: Kernel switching to idle Info 2020-10-01 19:57:30: Finished execution for NotebookImport#14 Info 2020-10-01 19:57:30: Finished executing cell NotebookImport#14 Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Oct 5, 2020

Sorry but I don’t know. You could check by installing the August release to see if we did a better job then. We should be just leaving the text/latex as is. The renderer for that comes from nteract.

0reactions
joyceerhlcommented, Oct 6, 2020

Yup, same behavior in the August release. Validated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Printing - SymPy 1.11 documentation
To explicitly not use L A T E X , pass use_latex=False to init_printing() or init_session() . To explicitly not use Unicode, pass...
Read more >
python 3.x - Cannot display latex in Sympy - Stack Overflow
enter code here I am a beginner in jupyter and am trying to do symbolic computations using sympy. after running the following code....
Read more >
SymPy - Printing - Tutorialspoint
If LATEX is not installed, but Matplotlib is installed, it will use the Matplotlib rendering engine. If Matplotlib is not installed, it uses...
Read more >
Setting up and using printers — SymPy tutorial at SciPy 2011 ...
and a Pyglet window with the LaTeX rendered expression will popup: ... Alternatively one can use SymPy's function init_printing().
Read more >
sympy.printing.latex — galgebra documentation - Read the Docs
is_Rational is False))) def _needs_function_brackets(self, ... For single-letter function names, render them as regular LaTeX math symbols.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found