Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-23 Thread Dima Pasechnik
My experiments with a pure upstream jupyterlab show that this is not 
reproducible there.
Namely:
1) clean up cache of your browser
2) create a fresh venv and pip install jupyterlab there, and the 
corresponding mathjax package:

$ python3 -m venv foo
$. foo/bin/activate
(foo) $ pip install jupyterlab
(foo) $ pip install jupyterlab-mathjax3

3) Disconnect the internet. Launch notebook

(foo) $ jupyterlab textest.ipynb # attached

4) Try evaluating cells (they all show nice mathjax - probably from a 
system package, but certainly not from a CDN)

-

IMHO it's yet another reason for stopping to vendor Jupyter(lab), and just 
using what's readily provided by the pure upstream!

Dima


On Friday, February 16, 2024 at 9:50:46 AM UTC Eric Gourgoulhon wrote:

> Hi Nils,
>
> Le vendredi 16 février 2024 à 04:37:28 UTC+1, Nils Bruin a écrit :
>
> On Thursday 15 February 2024 at 17:02:14 UTC-8 Dima Pasechnik wrote:
>
> but that's sphinx (Python), not jupyter.
>
> I see. The page I linked to is from Jupyter{book} which is, despite the 
> similarity in name, not the jupyter notebook server. 
>
>
> You are not alone: I did exactly the same thing ;-) After a google-search 
> for "jupyter custom mathjax", I ended up on the same page and for a second 
> I thought it contains the solution, before realizing that this page is 
> dedicated to the Sphinx generation of a book about Jupyter, not to Jupyter 
> itself. 
>
> Eric. 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/9a7e74af-57a7-48a5-abc8-ff1f37dca69en%40googlegroups.com.


textst.ipynb
Description: application/ipynb


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-16 Thread Eric Gourgoulhon
Hi Nils,

Le vendredi 16 février 2024 à 04:37:28 UTC+1, Nils Bruin a écrit :

On Thursday 15 February 2024 at 17:02:14 UTC-8 Dima Pasechnik wrote:

but that's sphinx (Python), not jupyter.

I see. The page I linked to is from Jupyter{book} which is, despite the 
similarity in name, not the jupyter notebook server. 


You are not alone: I did exactly the same thing ;-) After a google-search 
for "jupyter custom mathjax", I ended up on the same page and for a second 
I thought it contains the solution, before realizing that this page is 
dedicated to the Sphinx generation of a book about Jupyter, not to Jupyter 
itself. 

Eric. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/23ad2776-e5ae-4fcf-ba90-a186cc54b27an%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Nils Bruin
On Thursday 15 February 2024 at 17:02:14 UTC-8 Dima Pasechnik wrote:

but that's sphinx (Python), not jupyter.

I see. The page I linked to is from Jupyter{book} which is, despite the 
similarity in name, not the jupyter notebook server. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/f1f66402-bb16-4854-957e-870f9e7c61c2n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Dima Pasechnik
On Thu, Feb 15, 2024 at 11:56 PM Nils Bruin  wrote:

> 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:
> mathjax_path:
> https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
> ---
> (that's the URL that should change to mathjax 3. Supposedly one might be
> able to change that to a local resource)
>

but that's sphinx (Python), not jupyter.
jupyter is javascript, and its MathJax config is essentially a js script
which one puts into html files
inside  tags. Generation of this html happens whenever a
notebook is rendered, so there should be a template somewhere with this js
script.

In https://github.com/jupyter/notebook/blob/main/notebook/app.py#L89 one has
mathjax_url = self.settings.get(...)

being defaulted to a CDN, if an env.var. "mathjax_url" is not set. And
after that line you see code which looks like generation of an html page.

I believe the answer is somewhere in
https://github.com/jupyterlab/jupyterlab/issues/9911
(but now it's 1am here, and I'm lost there :-))





> 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+unsubscr...@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
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq0q7g3TEg_5ytEUkU_gGnXXhhWtbxN6yRN8NxVC%2B36Bow%40mail.gmail.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Nils Bruin
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:
mathjax_path: 
https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js  
---
(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+unsubscr...@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.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Dima Pasechnik
https://discourse.jupyter.org/t/notebook-with-mathjax-without-internet-connection/23958

On Thursday, February 15, 2024 at 5:37:31 PM UTC Matthias Koeppe wrote:

> I would suggest to raise the question what the best practices for offline 
> deployment are with the Jupyter project.
>
> On Thursday, February 15, 2024 at 9:30:10 AM UTC-8 Eric Gourgoulhon wrote:
>
>> Le jeudi 15 février 2024 à 13:36:46 UTC+1, Dima Pasechnik a écrit :
>>
>> 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.
>>
>>
>> Thank you Dima! Could you indicate how to do this? (looks quite technical 
>> to me)
>>  
>>
>>
>> See e.g. 
>> https://discourse.jupyter.org/t/running-voila-without-internet/13823/3
>>
>> where this is proposed for another MathJax-dependent project.
>>
>>
>> I am quite surprised that Jupyter does not offer a simple way to do 
>> this... In some countries, being offline is unfortunately more common than 
>> being online. 
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/451371f7-9674-4b4c-98a9-ead2dc39904bn%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Michael Orlitzky
On Thu, 2024-02-15 at 13:13 -0800, Nils Bruin wrote:
> According to the jupyter notebook documentation:
> 
> https://jupyterbook.org/en/stable/content/math.html
> 
> it should be possible to switch jupyter from using mathjax 2 to mathjax 3 
> by some configuration option (no clue where those configuration options 
> would go, and no indication is given in the tip either).

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.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/47eb509cbbc8aee21f317760f02c09a11d3a8733.camel%40orlitzky.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Nils Bruin
According to the jupyter notebook documentation:

https://jupyterbook.org/en/stable/content/math.html

it should be possible to switch jupyter from using mathjax 2 to mathjax 3 
by some configuration option (no clue where those configuration options 
would go, and no indication is given in the tip either). I would think that 
if one can switch to a different mathjax by just changing a URL in the 
config, one should be able to point that at local resources (a "file:" URL 
instead) to avoid any use of https, and hence hopefully the internet.

I'd be interested in hearing if someone figures out how to do that, since 
on my own (system) jupyter mathjax is severely hobbled: at some point 
jupyter decided to ship a stripped-down mathjax, so I don't get any 
dedicated mathfont goodness; only unicode approximations. I've tried to 
convince the server to use proper mathjax but failed. The jupyter server 
that comes packaged with sagemath does work well -- a small case where 
we're getting a benefit from sage-the-distribution.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/b3de134a-3bb4-43d4-b4ed-0fc187dc09f4n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Matthias Koeppe
I would suggest to raise the question what the best practices for offline 
deployment are with the Jupyter project.

On Thursday, February 15, 2024 at 9:30:10 AM UTC-8 Eric Gourgoulhon wrote:

> Le jeudi 15 février 2024 à 13:36:46 UTC+1, Dima Pasechnik a écrit :
>
> 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.
>
>
> Thank you Dima! Could you indicate how to do this? (looks quite technical 
> to me)
>  
>
>
> See e.g. 
> https://discourse.jupyter.org/t/running-voila-without-internet/13823/3
>
> where this is proposed for another MathJax-dependent project.
>
>
> I am quite surprised that Jupyter does not offer a simple way to do 
> this... In some countries, being offline is unfortunately more common than 
> being online. 
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/6157aabc-e66d-4eb1-a465-e19723c58065n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Eric Gourgoulhon
Le jeudi 15 février 2024 à 13:36:46 UTC+1, Dima Pasechnik a écrit :

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.


Thank you Dima! Could you indicate how to do this? (looks quite technical 
to me)
 


See e.g. 
https://discourse.jupyter.org/t/running-voila-without-internet/13823/3

where this is proposed for another MathJax-dependent project.


I am quite surprised that Jupyter does not offer a simple way to do this... 
In some countries, being offline is unfortunately more common than being 
online. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/a5970a85-4335-43fe-b79d-8eddd9065c07n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Dima Pasechnik
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.



On 15 February 2024 10:23:35 GMT, Kwankyu Lee  wrote:
>
>
>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?
>
>
>No. I would be happy if it is configurable as Dima said. 
>
>-- 
>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+unsubscr...@googlegroups.com.
>To view this discussion on the web visit 
>https://groups.google.com/d/msgid/sage-devel/053eb1b5-05c9-499a-ab19-2788af492bcen%40googlegroups.com.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/D8F519EB-61A0-425E-A84D-CEA0EC147EFB%40gmail.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Eric Gourgoulhon
Le jeudi 15 février 2024 à 11:20:40 UTC+1, Kwankyu Lee a écrit :

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 :-)  


Yes of course. By "tweaking" I actually meant "configuring". 
 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/88946834-d097-4aff-a793-a059e3f3d771n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Dima Pasechnik



On 15 February 2024 10:20:39 GMT, Kwankyu Lee  wrote:
>
>
>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 :-)  
>
>You may ask the feature to the Jupyter project. 

Ideally, this should be possible to specify in the Sage's Jupyter kernel, how 
you want MathJax for the notebooks set up.

As this is the only (?) regular way to communicate the wishes about a class of 
notebooks to the Jupiter(lab) server.

Dima
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/A051FFEC-7BE7-4C49-85D4-203EBA1818B6%40gmail.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Kwankyu Lee


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?


No. I would be happy if it is configurable as Dima said. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/053eb1b5-05c9-499a-ab19-2788af492bcen%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Kwankyu Lee


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 :-)  

You may ask the feature to the Jupyter project. 


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/da966d6b-3179-4381-b4b7-162a97c1cea0n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Dima Pasechnik



On 15 February 2024 09:18:06 GMT, Eric Gourgoulhon  
wrote:
>Le jeudi 15 février 2024 à 04:54:42 UTC+1, Kwankyu Lee a écrit :
>
>
>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)
>
>
>OK, thanks for the feedback!  Hence this is not a Ubuntu-specific issue. 
> 
>
>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.  
>
>
>This sounds a strange policy from Jupyter, since it prevents people from 
>using notebooks offline. Are you sure about this? 

I am sure it is configurable, just as well as you can configure delimiters used 
(i.e. $$ vs \(\), etc), etc.

> 
>
>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? 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/F0A1906E-5042-4713-A31C-6159F79C95B6%40gmail.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-15 Thread Eric Gourgoulhon
Le jeudi 15 février 2024 à 04:54:42 UTC+1, Kwankyu Lee a écrit :


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)


OK, thanks for the feedback!  Hence this is not a Ubuntu-specific issue. 
 

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.  


This sounds a strange policy from Jupyter, since it prevents people from 
using notebooks offline. Are you sure about this? 
 

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? 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/95e22d5b-090e-4e9d-9500-e3d31deb5349n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Kwankyu Lee


On Thursday, February 15, 2024 at 3:18:06 AM UTC+9 Eric Gourgoulhon wrote:

Le mercredi 14 février 2024 à 18:21:04 UTC+1, Matthias Koeppe a écrit :

You  may recall that we use jupyterlab_mathjax2 because of the discussion 
in https://github.com/sagemath/sage/pull/36129#issuecomment-1729218062


Thanks for reminding me about this. Then I guess the question is: why 
Jupyterlab in Sage 10.3.beta8 is using MathJax 2.7.7 (available only 
online) and not the system's MathJax (2.7.9) ? Again, there was no such 
issue with Sage 10.2. 


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. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/6a427ab7-55f7-4d64-a185-bb0a36d7a6c6n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Eric Gourgoulhon
Le mercredi 14 février 2024 à 18:21:04 UTC+1, Matthias Koeppe a écrit :

You  may recall that we use jupyterlab_mathjax2 because of the discussion 
in https://github.com/sagemath/sage/pull/36129#issuecomment-1729218062


Thanks for reminding me about this. Then I guess the question is: why 
Jupyterlab in Sage 10.3.beta8 is using MathJax 2.7.7 (available only 
online) and not the system's MathJax (2.7.9) ? Again, there was no such 
issue with Sage 10.2. 
 
 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5c672a08-3f82-4e55-a2f5-795558b386cbn%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Matthias Koeppe
You  may recall that we use jupyterlab_mathjax2 because of the discussion 
in https://github.com/sagemath/sage/pull/36129#issuecomment-1729218062



On Wednesday, February 14, 2024 at 8:04:30 AM UTC-8 Eric Gourgoulhon wrote:

> Le mercredi 14 février 2024 à 15:09:27 UTC+1, Eric Gourgoulhon a écrit :
>
> 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. 
>   
>
>
> Sage's MathJax 3.2.0 is definitely installed in my Sage 10.3.beta8 root 
> tree for if I look at the locally generated reference manual (i.e. 
> local/share/doc/sage/html/en/reference/index.html), the math formulas there 
> are rendered by MathJax 3.2.0 (as one can see by right-clicking on them and 
> selecting "About MathJax"); this works even in the offline mode.
>
> So it appears that Sage's MathJax 3.2.0 is used for the documentation but 
> not for Jupyter/Jupyterlab notebooks.
>   
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5d247114-3179-479a-b00c-a16057540524n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Eric Gourgoulhon
Le mercredi 14 février 2024 à 15:09:27 UTC+1, Eric Gourgoulhon a écrit :

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. 
  


Sage's MathJax 3.2.0 is definitely installed in my Sage 10.3.beta8 root 
tree for if I look at the locally generated reference manual (i.e. 
local/share/doc/sage/html/en/reference/index.html), the math formulas there 
are rendered by MathJax 3.2.0 (as one can see by right-clicking on them and 
selecting "About MathJax"); this works even in the offline mode.

So it appears that Sage's MathJax 3.2.0 is used for the documentation but 
not for Jupyter/Jupyterlab notebooks.
  

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/e22cc827-23ea-4446-a297-5738caf59dd5n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Eric Gourgoulhon
Le mercredi 14 février 2024 à 15:39:05 UTC+1, Kwankyu Lee a écrit :

On Wednesday, February 14, 2024 at 10:55:41 PM UTC+9 Eric Gourgoulhon wrote:

Le mercredi 14 février 2024 à 14:51:01 UTC+1, Eric Gourgoulhon a écrit :

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), 


Well, maybe not: the log contains:

Package 'mathjax' is currently not installed
No legacy uninstaller found for 'mathjax'; nothing to do


The log below this says mathjax 3.2.0 was installed. 


Indeed, but the indicated CPU time looks very short.
FWIW, here is the output of 
find . -name "*mathjax*"
in my Sage 10.3.beta8 root tree:

./build/pkgs/mathjax
./build/pkgs/jupyterlab_mathjax2
./src/doc/en/reference/spkg/mathjax.rst
./src/doc/en/reference/spkg/jupyterlab_mathjax2.rst
./logs/pkgs/jupyterlab_mathjax2-4.0.0.log
./logs/pkgs/mathjax-3.2.0.log
./upstream/mathjax-3.2.0.tar.gz
./upstream/jupyterlab_mathjax2-4.0.0-py3-none-any.whl
./local/var/lib/sage/venv-python3.10/var/lib/sage/installed/jupyterlab_mathjax2-4.0.0
./local/var/lib/sage/venv-python3.10/var/lib/sage/wheels/jupyterlab_mathjax2-4.0.0-py3-none-any.whl
./local/var/lib/sage/venv-python3.10/var/lib/sage/scripts/jupyterlab_mathjax2
./local/var/lib/sage/venv-python3.10/share/jupyter/lab/schemas/@jupyterlab/mathjax-extension
./local/var/lib/sage/venv-python3.10/share/jupyter/nbconvert/templates/base/mathjax.html.j2
./local/var/lib/sage/venv-python3.10/share/jupyter/labextensions/@jupyterlab/mathjax2-extension
./local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/jupyterlab/schemas/@jupyterlab/mathjax-extension
./local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/jupyterlab_mathjax2-4.0.0.dist-info
./local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/jupyterlab_mathjax2
./local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sphinx/ext/__pycache__/mathjax.cpython-310.pyc
./local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sphinx/ext/mathjax.py
./local/var/lib/sage/installed/mathjax-3.2.0
./local/share/mathjax
./local/share/mathjax/mathjax
./local/share/giac/doc/mathjax.sty
./local/share/doc/sage/doctrees/en/reference/spkg/jupyterlab_mathjax2.doctree
./local/share/doc/sage/doctrees/en/reference/spkg/mathjax.doctree
./local/share/doc/sage/html/en/reference/spkg/_sources/mathjax.rst.txt
./local/share/doc/sage/html/en/reference/spkg/_sources/jupyterlab_mathjax2.rst.txt
./local/share/doc/sage/html/en/reference/spkg/jupyterlab_mathjax2.html
./local/share/doc/sage/html/en/reference/spkg/mathjax.html

and that of find . -name "*mathjax-3*" :

./logs/pkgs/mathjax-3.2.0.log
./upstream/mathjax-3.2.0.tar.gz
./local/var/lib/sage/installed/mathjax-3.2.0

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/0645f7e5-9f09-49ee-a53a-6c7249a9b396n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Dima Pasechnik
That's why we should just stop shipping jupyterlab, and instead use one offered 
by the OS or some other standard Jupyter way. 

Here we are trying to solve already solved problems, what's the point of it?


On 14 February 2024 14:39:05 GMT, Kwankyu Lee  wrote:
>
>
>On Wednesday, February 14, 2024 at 10:55:41 PM UTC+9 Eric Gourgoulhon wrote:
>
>Le mercredi 14 février 2024 à 14:51:01 UTC+1, Eric Gourgoulhon a écrit :
>
>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), 
>
>
>Well, maybe not: the log contains:
>
>Package 'mathjax' is currently not installed
>No legacy uninstaller found for 'mathjax'; nothing to do
>
>
>The log below this says mathjax 3.2.0 was installed. 
>
>-- 
>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+unsubscr...@googlegroups.com.
>To view this discussion on the web visit 
>https://groups.google.com/d/msgid/sage-devel/5b52e3ee-c409-4721-9689-424c27648dadn%40googlegroups.com.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/DA72C742-5F42-4366-80DB-0ECC38F3188B%40gmail.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Kwankyu Lee


On Wednesday, February 14, 2024 at 10:55:41 PM UTC+9 Eric Gourgoulhon wrote:

Le mercredi 14 février 2024 à 14:51:01 UTC+1, Eric Gourgoulhon a écrit :

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), 


Well, maybe not: the log contains:

Package 'mathjax' is currently not installed
No legacy uninstaller found for 'mathjax'; nothing to do


The log below this says mathjax 3.2.0 was installed. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5b52e3ee-c409-4721-9689-424c27648dadn%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Eric Gourgoulhon
Le mercredi 14 février 2024 à 14:51:01 UTC+1, Eric Gourgoulhon a écrit :


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...


If I do the same thing when the computer is offline with Sage 10.2, I get 
"MathJax v2.7.9", which is 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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/8a163bfb-0b2c-483a-a5da-faf8b62361a4n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Eric Gourgoulhon


Le mercredi 14 février 2024 à 14:51:01 UTC+1, Eric Gourgoulhon a écrit :

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), 


Well, maybe not: the log contains:

Package 'mathjax' is currently not installed
No legacy uninstaller found for 'mathjax'; nothing to do


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/6e4b03e6-1d4f-4287-8668-81f5b46046ebn%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Eric Gourgoulhon


Le mercredi 14 février 2024 à 14:18:20 UTC+1, Eric Gourgoulhon a écrit :

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. 


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...
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), but apparently it is 
not used in the notebook. 


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5d5e1a02-edf2-4efa-9bec-be674e851f4fn%40googlegroups.com.
Using cached file /home/eric/sage/10.3/upstream/mathjax-3.2.0.tar.gz
mathjax-3.2.0

Setting up build directory for mathjax-3.2.0
Finished extraction
No patch files found in ../patches

Host system:
Linux tensor 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) 

Package 'mathjax' is currently not installed
No legacy uninstaller found for 'mathjax'; nothing to do
src/mathjax -> /home/eric/sage/10.3/local/var/tmp/sage/build/mathjax-3.2.0/inst/home/eric/sage/10.3/local/share/mathjax

real	0m0.053s
user	0m0.009s
sys	0m0.041s
Moving package files from temporary location /home/eric/sage/10.3/local/var/tmp/sage/build/mathjax-3.2.0/inst to /home/eric/sage/10.3/local
Successfully installed mathjax-3.2.0
Deleting temporary build directory
/home/eric/sage/10.3/local/var/tmp/sage/build/mathjax-3.2.0
Finished installing mathjax-3.2.0


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Eric Gourgoulhon


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. Moreover, on the same computer, MathJax display works well when 
offline with Sage 10.2. 


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/8ef574c7-7156-4f67-849a-c0dfb4b3bd10n%40googlegroups.com.


Re: [sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Dima Pasechnik
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.



On 14 February 2024 12:47:52 GMT, Eric Gourgoulhon  
wrote:
>Hi,
>
>While working on a Sage 10.3.beta  notebook in a train without any internet 
>connection, I've noticed that there is no LaTeX rendering via MathJax, 
>neither in the markdown cells nor in the output cells within the scope of  
>%display latex. There is no such issue with Sage 10.2 and I've opened 
>https://github.com/sagemath/sage/issues/36914
>for this. 
>
>Apparently, the problem arises with Ubuntu 22.04, but not with macOS. It 
>would be nice to have more tests, possibly on various OS, to identify the 
>issue. Thanks for your feedback!
>
>Eric. 
>
>-- 
>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+unsubscr...@googlegroups.com.
>To view this discussion on the web visit 
>https://groups.google.com/d/msgid/sage-devel/4ab5d581-0ba9-4e30-9ad1-06250d66053an%40googlegroups.com.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/7451009B-032F-4B5C-AB33-6F4E7E8C1B9F%40gmail.com.


[sage-devel] No MathJax display in Sage 10.3.beta notebooks when offline

2024-02-14 Thread Eric Gourgoulhon
Hi,

While working on a Sage 10.3.beta  notebook in a train without any internet 
connection, I've noticed that there is no LaTeX rendering via MathJax, 
neither in the markdown cells nor in the output cells within the scope of  
%display latex. There is no such issue with Sage 10.2 and I've opened 
https://github.com/sagemath/sage/issues/36914
for this. 

Apparently, the problem arises with Ubuntu 22.04, but not with macOS. It 
would be nice to have more tests, possibly on various OS, to identify the 
issue. Thanks for your feedback!

Eric. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/4ab5d581-0ba9-4e30-9ad1-06250d66053an%40googlegroups.com.