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

Long math expression in output is not wrapped unlike notebook 6 #7055

Closed
2 of 3 tasks
kwankyu opened this issue Sep 18, 2023 · 4 comments
Closed
2 of 3 tasks

Long math expression in output is not wrapped unlike notebook 6 #7055

kwankyu opened this issue Sep 18, 2023 · 4 comments

Comments

@kwankyu
Copy link

kwankyu commented Sep 18, 2023

Hi,

Testing notebook 7 with SageMath, we noticed long math expression rendered by MathJax 3 is not wrapped, unlike notebook 6.

See sagemath/sage#36129 (comment)

I hope this behavioral change is not intended. I think it is a bug.

  • checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository

I checked the issue on Chrome browser both with notebook 7.0.3 and jupyterlab 4.0.6

@krassowski
Copy link
Member

Just for context, this is a know issue in MathJax 3 and will probably be resolved by upgrading @jupyterlab/mathjax to MathJax 4 once it is released (see jupyterlab/jupyterlab#14570). For now you can install jupyterlab-mathjax2 to downgrade to previous MathJax version (which is a trade=off because that has performance impact).

@kwankyu
Copy link
Author

kwankyu commented Sep 20, 2023

I am not sure if this is the same issue with jupyterlab/jupyterlab#14570. The math expression does not use \\; it is a single long expression (a polynomial).

On the other hand, I could confirm that it is an issue of mathax3 vs mathjax2. No problem with Notebook 7 itself.

Thank you for attention.

@kwankyu kwankyu closed this as completed Sep 20, 2023
@dimpase
Copy link

dimpase commented Feb 26, 2024

Isn't it possible to fix this by an appropriate CSS styling of mjx-container?

I noticed that placing and evaluating an html cell in the notebook, like this:

%%html
<style>
mjx-container {
  overflow-x: auto;
  overflow-wrap: break-word;
  max-width: 50%;
  }
</style>

does make the window to show a displayed LaTeX formula narrow (50% width, as requested), but does not force formula wrapping.

It could be a bug/missing feature in MathJax-3, I don't know.

@dimpase
Copy link

dimpase commented Feb 26, 2024

install jupyterlab-mathjax2 to downgrade to previous MathJax version (which is a trade=off because that has performance impact).

apart from performance impact, it breaks off-line display of MathJax. Not sure whether this can be considered a bug in jupyterlab-mathjax2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants