MyST-NB
MyST-NB copied to clipboard
`Code` displayed by cell generates invalid source when rendered to LaTeX
I think the culprit is this routine: https://github.com/executablebooks/MyST-NB/blob/385c4a7afb3a377486c1aa7a86b4c8a0e93484f5/myst_nb/core/render.py#L623
Given a code cell with the following
from IPython.display import Code
Code("x = 1", language="python")
the resulting LaTeX (from the MIME bundle key "text/latex") is written to the document inside of an equation environment, which breaks things.
I don't know what the solution is, here - without parsing the LaTeX. we don't know whether it's math or not.