Skip to content
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

markdown equation rendering is suppressed if preceded by fenced code block #7106

Closed
stevengj opened this issue Oct 12, 2023 · 5 comments
Closed
Labels
bug status:Needs Info status:Needs Triage Applied to issues that need triage

Comments

@stevengj
Copy link

stevengj commented Oct 12, 2023

The following issue was reported in JuliaLang/IJulia.jl#1096, but is also reproducible with the Python kernel, so it seems to be an issue of the Jupyter notebook front end.

Basically, under some circumstances the rendering of LaTeX equations in Markdown text is suppressed if the text is preceded by a fenced code block. A minimal reproducer is:

from IPython.display import display, Markdown
display(Markdown('''
```
foo
```

Some maths: $\sqrt{1 + x}$.
'''))

which is rendered in my Jupyter (6.5.4) notebook as follows, without LaTeX math formatting:

image

If I simply remove the fenced code block from the beginning of the Markdown string, then the equation renders correctly:

image
@stevengj stevengj added bug status:Needs Triage Applied to issues that need triage labels Oct 12, 2023
@RRosio
Copy link
Collaborator

RRosio commented Oct 17, 2023

Thank you for opening this issue @stevengj. Would you be able to try this in Notebook 7 to see if you encounter this issue?

@stevengj
Copy link
Author

stevengj commented Oct 17, 2023

I don't have version 7 of the notebook in my conda-forge installation, even after updating. jupyter --version gives:

Selected Jupyter core packages...
IPython          : 7.31.1
ipykernel        : 6.15.2
ipywidgets       : 7.6.5
jupyter_client   : 7.4.9
jupyter_core     : 4.11.1
jupyter_server   : 1.23.4
jupyterlab       : 3.5.3
nbclient         : 0.5.13
nbconvert        : 6.5.4
nbformat         : 5.7.0
notebook         : 6.5.2
qtconsole        : 5.4.0
traitlets        : 5.7.1

However, it works fine in JupyterLab 3.5.3:
image

Can someone with Jupyter Notebook 7.x try pasting in the code and see whether it works?

@jtpio
Copy link
Member

jtpio commented Oct 17, 2023

@stevengj this is what it looks like with Notebook 7.0.6 (the latest release at the moment):

image

@stevengj
Copy link
Author

Ok, great, it's fixed in the latest version? In that case I guess this issue can be closed?

@JasonWeill
Copy link
Collaborator

Closing because this is fixed in Notebook 7. Thanks for your help, @stevengj !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status:Needs Info status:Needs Triage Applied to issues that need triage
Projects
None yet
Development

No branches or pull requests

4 participants