For off the grid working with MathJax, you need it locally installed. It might be that by default it doesn't happen, and MathJax is dynamically loaded from the net.
Le mercredi 14 février 2024 à 14:13:04 UTC+1, Dima Pasechnik a écrit :For off the grid working with MathJax, you need it locally installed. It might be that by default it doesn't happen, and MathJax is dynamically loaded from the net.The Ubuntu packages libjs-mathjax and fonts-mathjax are installed on my system.
What is puzzling is that MathJax 3.2.0 seems to have been successfully installed in the Sage tree during the install of Sage 10.3.beta*, cf. the attached log (SAGE_ROOT/logs/pkgs/mathjax-3.2.0.log),
More precisely, the Ubuntu 22.04's libjs-mathjax is version 2.7.9.When the computer is online and I right-click on "About MathJax" in a displayed cell, I get "MathJax v2.7.7", which is not the system version...
The partial conclusion is thus:- Sage 10.2 uses Ubuntu 22.04's MathJax (v2.7.9), so there is no issue when the computer is offline.- for some reason, Sage 10.3.beta* refuses to use Ubuntu 22.04's MathJax and the MathJax 3.2.0 shipped with Sage is not installed/used either.
You may recall that we use jupyterlab_mathjax2 because of the discussion in https://github.com/sagemath/sage/pull/36129#issuecomment-1729218062
I checked again on mac. Yes, jupyterlab (and notebook 7 as well) of Sage 10.3.beta8 fails in loading mathjax 2.7.7. (Before it worked because of the cache, I guess)
It seems that jupyterlab(notebook 7) only uses mathjax cdn. (As far as I know, jupyter never used system mathjax or sage mathjax).I guess that before notebook 7, jupyter vendored mathjax with it, but after notebook 7, jupyter only uses cdn.
Hence there is nothing to do on sage side.
With the previous version of Jupyterlab shipped with Sage 10.2, the system's MathJax was used.
Can't we tweak the new Jupyterlab shipped with Sage 10.3 to use the system's MathJax as well?
I guess that before notebook 7, jupyter vendored mathjax with it, but after notebook 7, jupyter only uses cdn.This sounds a strange policy from Jupyter, since it prevents people from using notebooks offline. Are you sure about this?
With the previous version of Jupyterlab shipped with Sage 10.2, the system's MathJax was used.Can't we tweak the new Jupyterlab shipped with Sage 10.3 to use the system's MathJax as well?We don't do that. Perhaps tweaking is more severe sin than sage vendoring jupyter, from Dima's viewpoint :-)
A possible solution does not involve changing Sage/Jupyter config. It's by capturing http requests to CDN and replacing them with the local resources.
See e.g. https://discourse.jupyter.org/t/running-voila-without-internet/13823/3
where this is proposed for another MathJax-dependent project.
The notebook release process minifies all of its javascript code. The
bit that sets the MathJax options is in there somewhere but good luck
finding it.
On Thursday 15 February 2024 at 13:19:47 UTC-8 Michael Orlitzky wrote:
The notebook release process minifies all of its javascript code. The
bit that sets the MathJax options is in there somewhere but good luck
finding it.
Well, the text in the tip looks more like config file content than javascript, so whoever wrote the tip probably didn't propose to change javascript. Supposedly, they had a config file in mind somewhere, which would not be minified. I have very limited knowledge of the configuration mechanics of jupyter.The snippet looks like this:------------------------------------sphinx:config:-----------------------------------(that's the URL that should change to mathjax 3. Supposedly one might be able to change that to a local resource)
Hopefully jupyter can provide a more obvious way to tweak this option, but even knowing where one can change this option effectively might already be useful (especially in cases where the default doesn't do what one wants).
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/d4823c77-7dba-4210-9192-e286d4f109abn%40googlegroups.com.
but that's sphinx (Python), not jupyter.