microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.27k stars 284 forks source link

Extra space on MathJax formula using sympy. #14948

Open alex180500 opened 8 months ago

alex180500 commented 8 months ago

Applies To

What happened?

This issue comes from https://github.com/sympy/sympy/issues/25979.

import sympy.physics.quantum as q
import sympy

sympy.init_printing(use_latex="mathjax")

ket = q.Ket("x")
q.Dagger(ket) * ket

Which has this output $\displaystyle \left\langle x \right. {\left|x\right\rangle }$.

This is how it is displayed in VS Code:

image

But it should be displayed correctly as: $\displaystyle \left\langle x \right. {\left|x\right\rangle }$. This is a problem due to the MathJax implementation of VS Code inside the notebook I guess.

VS Code Version

1.85.1

Jupyter Extension Version

v2023.11.1003402403

Jupyter logs

Visual Studio Code (1.85.1, undefined, desktop)
Jupyter Extension Version: 2023.11.1003402403.
Python Extension Version: 2023.22.1.
Pylance Extension Version: 2023.12.1.
Platform: win32 (x64).
Multiple Workspace folders opened ~\My Drive\Dottorato\PhD Code, ~\My Drive\Thesis\Thesis Code, ~\My Drive\Fisica Shared, ~\Palermo, ~\Desktop\Coding, ~\My Drive\LaTeX, ~\.matplotlib\stylelib
11:28:39.936 [info] Start refreshing Kernel Picker (1703154519936)
11:28:39.940 [info] Using Pylance
11:28:40.002 [info] Start refreshing Interpreter Kernel Picker
11:28:40.878 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd0b02cdf31a9815909912e2c99d4f59f1dc3c12f928634740340c21e0b01298bf3.~\miniforge3\envs\comp_net\python.exe.~\miniforge3\envs\comp_net\python.exe.-m#ipykernel_launcher  (Python Path: ~\miniforge3\envs\comp_net\python.exe, Conda, comp_net, 3.12.0) for '~\My Drive\Dottorato\PhD Code\Food Network 2\create_network.ipynb' (disableUI=true)
11:28:49.666 [info] End refreshing Kernel Picker (1703154519936)
11:28:50.295 [info] Process Execution: ~\miniforge3\envs\comp_net\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
11:28:50.307 [info] Process Execution: ~\miniforge3\envs\comp_net\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 10776
    > cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\pythonFiles\vscode_datascience_helpers
11:28:50.358 [info] Process Execution: ~\miniforge3\envs\comp_net\python.exe -m pip list
11:28:50.549 [info] Process Execution: ~\miniforge3\envs\comp_net\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v2-10776t8dZS1YK5VsC.json
    > cwd: ~\My Drive\Dottorato\PhD Code\Food Network 2
11:28:51.697 [warn] No interpreter for Pylance for Notebook URI "~\My Drive\Dottorato\PhD Code\Various\issue_vscode.ipynb"
11:28:52.749 [warn] StdErr from Kernel Process 0.01s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
11:28:53.551 [info] Process Execution: ~\miniforge3\envs\comp_net\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\pythonFiles\printJupyterDataDir.py
11:28:53.635 [warn] Got a non-existent Jupyer Data Dir file:///c%3A/Users/<username>/AppData/Roaming/Python/share/jupyter
11:28:54.707 [info] Handle Execution of Cells 0 for ~\My Drive\Dottorato\PhD Code\Various\issue_vscode.ipynb
11:28:54.713 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd05a18e1050da49b3ab4bc844da5b120df8344e2e5fe34e720fa658460e31bb145.~\miniforge3\envs\physics\python.exe.~\miniforge3\envs\physics\python.exe.-m#ipykernel_launcher  (Python Path: ~\miniforge3\envs\physics\python.exe, Conda, physics, 3.12.0) for '~\My Drive\Dottorato\PhD Code\Various\issue_vscode.ipynb' (disableUI=false)
11:28:56.605 [info] Process Execution: ~\miniforge3\envs\physics\python.exe -m pip list
11:28:56.655 [info] Process Execution: ~\miniforge3\envs\physics\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
11:28:56.667 [info] Process Execution: ~\miniforge3\envs\physics\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v2-10776WY8CpL20Mxas.json
    > cwd: ~\My Drive\Dottorato\PhD Code\Various
11:28:58.722 [warn] StdErr from Kernel Process 0.01s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
11:28:59.313 [info] Process Execution: ~\miniforge3\envs\physics\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\pythonFiles\printJupyterDataDir.py
11:28:59.322 [info] Kernel acknowledged execution of cell 0 @ 1703154539322
11:28:59.400 [warn] Got a non-existent Jupyer Data Dir file:///c%3A/Users/<username>/AppData/Roaming/Python/share/jupyter
11:29:01.199 [info] End cell 0 execution after 1.877s, completed @ 1703154541199, started @ 1703154539322
alex180500 commented 7 months ago

no updates?