[sage-devel] Re: Replacing %display latex with %display html

2021-03-23 Thread Eric Gourgoulhon
Hi, Le mardi 23 mars 2021 à 16:49:07 UTC+1, Kwankyu Lee a écrit : > Hi all, > > Changes by ticket #31536 may cause unexpected regressions in Sage in > jupyter notebook. Please test and leave comments. > > Here is the address: https://trac.sagemath.org/ticket/31536 > May I take the opportunit

[sage-devel] Re: Replacing %display latex with %display html

2021-03-23 Thread Eric Gourgoulhon
PS: IMHO, things like %display latex or %display html are hindrances for newcomers. Le mardi 23 mars 2021 à 19:13:10 UTC+1, Eric Gourgoulhon a écrit : > Hi, > > Le mardi 23 mars 2021 à 16:49:07 UTC+1, Kwankyu Lee a écrit : > >> Hi all, >> >> Changes by ticket #31536 may cause unexpected regress

[sage-devel] Re: Replacing %display latex with %display html

2021-03-24 Thread Eric Gourgoulhon
Back to the main point of this thread: I understand that %display latex has some issues (related to MathJax) in its current implementation but I would say that from the *end user* point of view, changing %display latex to %display html might not be a good thing. Indeed %display html sounds like

Re: [sage-devel] Re: Replacing %display latex with %display html

2021-03-23 Thread Thierry
Hi, On Tue, Mar 23, 2021 at 11:20:05AM -0700, Eric Gourgoulhon wrote: > PS: IMHO, things like %display latex or %display html are hindrances for > newcomers. I understand that this is not the point, but for what it worth, i prefer the default to remain the current plain text, as it provides more

Re: [sage-devel] Re: Replacing %display latex with %display html

2021-03-23 Thread William Stein
Because I created this years before Jupyter started... it would be great to redo it. On Tue, Mar 23, 2021 at 11:13 AM Eric Gourgoulhon wrote: > Hi, > > Le mardi 23 mars 2021 à 16:49:07 UTC+1, Kwankyu Lee a écrit : > >> Hi all, >> >> Changes by ticket #31536 may cause unexpected regressions in S

Re: [sage-devel] Re: Replacing %display latex with %display html

2021-03-23 Thread Eric Gourgoulhon
Le mardi 23 mars 2021 à 19:37:33 UTC+1, Thierry (sage-googlesucks@xxx) a écrit : > Hi, > > On Tue, Mar 23, 2021 at 11:20:05AM -0700, Eric Gourgoulhon wrote: > > PS: IMHO, things like %display latex or %display html are hindrances for > > newcomers. > > I understand that this is not the poin

Re: [sage-devel] Re: Replacing %display latex with %display html

2021-03-23 Thread Eric Gourgoulhon
Le mardi 23 mars 2021 à 20:28:45 UTC+1, wst...@gmail.com a écrit : > Because I created this years before Jupyter started... > Ah yes! it would be great to redo it. > As a starting point, it would suffice to endow the class SageObject with a method _repr_latex_ defined as something like

Re: [sage-devel] Re: Replacing %display latex with %display html

2021-03-23 Thread Kwankyu Lee
On Wednesday, March 24, 2021 at 5:49:41 AM UTC+9 Eric Gourgoulhon wrote: > Le mardi 23 mars 2021 à 20:28:45 UTC+1, wst...@gmail.com a écrit : > >> Because I created this years before Jupyter started... >> > > Ah yes! > > it would be great to redo it. >> > > As a starting point, it would suffi

Re: [sage-devel] Re: Replacing %display latex with %display html

2021-03-23 Thread Kwankyu Lee
There is an error in my description of the present situation. Let me correct it. Presently, show(obj) shows the latex+mathjax representation wrapped in html, which is the rich output of the object. The ticket changes the rich output of the object to the html+mathjax representation, which you

Re: [sage-devel] Re: Replacing %display latex with %display html

2021-03-24 Thread Eric Gourgoulhon
A small update: using the method _latex_ pointed out by Kwankyu, the implementation of _repr_latex_ in the class SageObject could become: def _repr_latex_(self): try: return '$' + str(self._latex_()) + '$' except AttributeError: return None # if None

Re: [sage-devel] Re: Replacing %display latex with %display html

2021-03-24 Thread Eric Gourgoulhon
Sorry, the str(...) is not required since self._latex_() returns a string. So SageObject._repr_latex_ can be simplified to: def _repr_latex_(self): try: return '$' + self._latex_() + '$' except AttributeError: return None # if None is returned, plain

Re: [sage-devel] Re: Replacing %display latex with %display html

2021-03-24 Thread Eric Gourgoulhon
Le mardi 23 mars 2021 à 21:40:13 UTC+1, Eric Gourgoulhon a écrit : > Le mardi 23 mars 2021 à 19:37:33 UTC+1, Thierry (sage-googlesucks@xxx) a > écrit : > >> Hi, >> >> On Tue, Mar 23, 2021 at 11:20:05AM -0700, Eric Gourgoulhon wrote: >> > PS: IMHO, things like %display latex or %display html ar