ipywidgets
ipywidgets copied to clipboard
MathJax3 in Jupyterlab4
It looks like JupyterLab 4 switched to using MathJax3 (https://github.com/jupyterlab/jupyterlab/pull/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: https://github.com/jtpio/ipylab/issues/129#issuecomment-1696979893
See also the Label and HTMLMath widgets currently don't render correctly.
https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20List.html#label https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20List.html#html-math
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.
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
maybe that helps someone who knows how to read this ;)
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?
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
Thanks for the reply i will have to try the newest version then!