2

I am trying to run some interactive cells in a Jupyter notebook on VScode but LaTeX on sliders descriptors is not rendered at all, while in matplotlib plots it's rendered correctly. Opening a jupyter notebook in the browser all the LaTeX labels are rendered correctly instead.

I checked out this other thread but it looks as the basic requirements are ok. Here is my jupyter --version output

Selected Jupyter core packages...
IPython          : 8.4.0
ipykernel        : 6.15.2
ipywidgets       : 7.7.1
jupyter_client   : 7.4.7
jupyter_core     : 4.11.2
jupyter_server   : 1.18.1
jupyterlab       : 3.5.0
nbclient         : 0.5.13
nbconvert        : 6.5.4
nbformat         : 5.5.0
notebook         : 6.5.2
qtconsole        : 5.3.2
traitlets        : 5.4.0

Code:


import ipywidgets as widgets
import matplotlib.pyplot as plt
%matplotlib widget
latext = "$n_\\alpha$"
widgets.FloatSlider(min=1., max=4.0, value=2, step = 0.01, description = latext)
plt.plot(range(10))
plt.xlabel(latext)
plt.show()

Expected behaviour:

enter image description here

0 Answers0