executablebooks / MyST-NB

Parse and execute ipynb files in Sphinx
https://myst-nb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
205 stars 84 forks source link

LaTeX text rendered as math (nowrap=False in render_text_latex) #381

Open amcdawes opened 2 years ago

amcdawes commented 2 years ago

Describe the problem

Some Jupyter notebooks output LaTeX that includes both text and math (see the QuTiP package for example). Myst-nb renders this as all math by wrapping with \begin{split} and \end{split}.

This is not consistent with the behavior of the jupyter notebook environment.

It seems like either setting nowrap=True or allowing an override would be ideal.

Link to your repository or website

https://github.com/amcdawes/qutip-book/issues/6

Steps to reproduce

  1. Include QuTiP output in a jupyter book notebook
    from qutip import *
    qeye(2)
  2. Build jb build qutip-book

The version of Python you're using

3.7.10

Your operating system

Mac OSX 11.6

Versions of your packages

Jupyter Book : 0.12.1 External ToC : 0.2.3 MyST-Parser : 0.15.2 MyST-NB : 0.13.1 Sphinx Book Theme : 0.1.7 Jupyter-Cache : 0.4.3 NbClient : 0.5.3 QuTiP: 4.6.2

Additional context

I also opened this on jupyter-book, I was not sure where best to raise the issue (https://github.com/executablebooks/jupyter-book/issues/1595)

welcome[bot] commented 2 years ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada: