widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.62k stars 105 forks source link

Latex example does not work in solara 1.17.5 #175

Closed kolibril13 closed 3 months ago

kolibril13 commented 10 months ago

I have a small bug to report: I've just tried to copy+paste this latex example https://solara.dev/api/markdown, but it does not seem to work on the latest Solana version: image

maartenbreddels commented 10 months ago

Thanks for the report,

Weird thing is that after running:

from IPython.display import Math
Math(data='E \sim mc^2')

It does work, which means that window.MathJax is only available after some mathjax extensions/bundle/chunk is loaded in the notebook.

kolibril13 commented 10 months ago

Indeed, that's weird, your example also works on my machine. Don't know if you know about https://katex.org/, maybe that's an alternative.

maartenbreddels commented 10 months ago

Yes, but I prefer to stay close to ipywidgets/jupyter, which uses mathjax.

maartenbreddels commented 10 months ago

or do you see strong reasons to switch, and do you know if it is compatible?

kolibril13 commented 10 months ago

I recently read an article that mentioned katex as alternative fast latex renderer. But I see that it makes total sense to stay with the ipywidgets default mathjax option.

iisakkirotko commented 4 months ago

Hi! Just to update the conversation here as well, it seems like https://github.com/jupyter-widgets/ipywidgets/pull/3847 fixes this issue in ipywidgets, so perhaps we can continue developing on their success.