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

Problem with Ipython.display Markdown with math #636

Open
WKorzen opened this issue Sep 19, 2024 · 2 comments
Open

Problem with Ipython.display Markdown with math #636

WKorzen opened this issue Sep 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@WKorzen
Copy link

WKorzen commented Sep 19, 2024

Describe the bug

context
When I do create ipynb with cell

text2 = ('Lorem ipsum $x$ lorem $A$ ipsum?\n'
           '\t\\[\n\t\t\\text{A=}\\left[\\begin{matrix}2 x + 4 & x - 4\\\\x + 1 & -1\\end{matrix}\\right]\n'
           '\t\\]\n'
           'Lorem ipsum $x=-2.$ Ipsum lorem.\n')

and

Markdown(text2.replace('\\[','$$').replace('\\]','$$'))

I receive wrong result generated by sphinx with myst_nb

image

expectation
I expected like in jupyter lab
image

bug
But i received
image

Reproduce the bug

  • Create ipynb and add to index
  • make html

List your environment

installed:

myst-nb                       1.1.1
myst-parser                   4.0.0
jupyter                       1.1.1
jupyter-cache                 1.0.0
jupyter_client                8.6.2
jupyter-console               6.6.3
jupyter_core                  5.7.2
jupyter-events                0.10.0
jupyter-lsp                   2.2.5
jupyter_server                2.14.2
jupyter_server_terminals      0.5.3
jupyterlab                    4.2.5
jupyterlab_pygments           0.3.0
jupyterlab_server             2.27.3
jupyterlab_widgets            3.0.13
nbsphinx                      0.9.5
sphinx-autoapi                3.3.1
sphinx-rtd-theme              2.0.0
sphinxcontrib-applehelp       2.0.0
sphinxcontrib-devhelp         2.0.0
sphinxcontrib-htmlhelp        2.1.0
sphinxcontrib-jquery          4.1
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          2.0.0
sphinxcontrib-serializinghtml 2.0.0

my conf.py:

project = u"test"
   
extensions = [
         "myst_nb"
]

exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

html_theme = "sphinx_rtd_theme"
@WKorzen WKorzen added the bug Something isn't working label Sep 19, 2024
@bsipocz
Copy link
Collaborator

bsipocz commented Sep 19, 2024

I haven't tried a fix here, but for LaTeX heavy notebooks over at astroml-notebooks, padding the equations with empty lines solved these rendering issues for me.

@WKorzen
Copy link
Author

WKorzen commented Sep 20, 2024

I haven't tried a fix here, but for LaTeX heavy notebooks over at astroml-notebooks, padding the equations with empty lines solved these rendering issues for me.

Thanks, I tried and received:
image

I also tried 'dollarmath' (works with nbsphinx) and 'amsmath' extensions unfortunately without success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants