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

MathJax3 in Jupyterlab4 #3829

Open
fleming79 opened this issue Aug 29, 2023 · 6 comments
Open

MathJax3 in Jupyterlab4 #3829

fleming79 opened this issue Aug 29, 2023 · 6 comments
Labels

Comments

@fleming79
Copy link

It looks like JupyterLab 4 switched to using MathJax3 (jupyterlab/jupyterlab#13877).

Looking in the source for ipywidgets ipywidgets/packages/controls/src/utils.ts the function typeset hasn't been upgraded to work with MathJax3. source here and copied below.

export function typeset(element: HTMLElement, text?: string): void {
  if (text !== void 0) {
    element.textContent = text;
  }
  if ((window as any).MathJax !== void 0) {
    MathJax!.Hub!.Queue(['Typeset', MathJax.Hub, element]);
  }
}

The MathJax upgrade notes here explain that Mathjax.Hub has" been removed entirely" which results in an attribute error in the code snippet above Mathjax content is not empty.

The issue was observed in the package ipylab which subclasses a VBox to create new classes Panel and SplitPanel. The issue is reported here: jtpio/ipylab#129 (comment)

@fleming79
Copy link
Author

@mathcodemaster
Copy link

Hello, i am struggling with for some time now, happy to see that someone identified the problem,
i have no idea how i could contribute to fix such an issue, but i am here as a support!
I am sure that helps everybody a lot.
I was wondering if there is a possibility to switch back to mathjax2 in the meantime, but was not successful.

@mathcodemaster
Copy link

As i said, i probably cant contribute much do the solution, but i would be very happy if that gets fixed so what i found is the update manual from mathjax at:
https://docs.mathjax.org/en/latest/upgrading/v2.html
image

maybe that helps someone who knows how to read this ;)

@mathcodemaster
Copy link

hello there,
i just wanted to ask in on the state of this issue.
do i see it right that latex is not working for ipywidgets at the moment at all, since this bug is out there?
i regularly check in on the ipywidgets documentation at

https://ipywidgets.readthedocs.io/en/8.1.3/examples/Widget%20Layout.html#latex

and it is still also broken there.

Is there any way of going around this?

@fleming79
Copy link
Author

I think it has been resolved by this PR, but as you say still doesn't render in the documentation. Have you tried with the latest version of jupyterlab_widgets?

pip install -U jupyterlab_widgets

image

@mathcodemaster
Copy link

Thanks for the reply i will have to try the newest version then!

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

No branches or pull requests

3 participants