ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.2k stars 806 forks source link

python-markdown prevents some LaTeX from rendering correctly #1526

Open ChemGuy88 opened 3 years ago

ChemGuy88 commented 3 years ago

Some LaTeX doesn't get rendered in Jupyter Notebooks when using the python-markdown extension.

For example:

code cell:

x = 1+1

markdown cell:

$$y = {{x}}z$$

which appears as LaTeX code with some HTML in it. Namely, some <span id> tags. See attached picture.

Screen Shot 2020-09-10 at 4 48 38 PM

My problem seems to be the same as these two posted in Stackoverflow.

I tried the solution proposed here, but it resulted in a weird rendering. See attached picture.

Screen Shot 2020-09-10 at 4 42 59 PM

The only errors I'm getting on the console seem to be about canopy/ and widgets/.

[W 15:35:05.188 NotebookApp] 404 GET /nbextensions/canopy/training/exercise.js?v=20200910153500 (::1) 8.06ms referer=http://localhost:8888/notebooks/hw1.ipynb
[W 15:35:05.194 NotebookApp] 404 GET /nbextensions/canopy.js?v=20200910153500 (::1) 2.65ms referer=http://localhost:8888/notebooks/hw1.ipynb
[W 15:35:05.195 NotebookApp] 404 GET /nbextensions/canopy/training.js?v=20200910153500 (::1) 2.72ms referer=http://localhost:8888/notebooks/hw1.ipynb
[W 15:35:05.196 NotebookApp] 404 GET /nbextensions/canopy/main.js?v=20200910153500 (::1) 3.04ms referer=http://localhost:8888/notebooks/hw1.ipynb
[W 15:35:05.306 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200910153500 (::1) 1.67ms referer=http://localhost:8888/notebooks/hw1.ipynb
ChemGuy88 commented 3 years ago

I was able to get the desired result, but it's not as easy as the python-markdown README had led me to believe. Is my approach the easiest way? I had to use a lot of curly braces {} ...

Markdown latex

Screen Shot 2020-09-10 at 5 14 02 PM

Rendered markdown latex:

Screen Shot 2020-09-10 at 5 14 15 PM