jupyter horizontal scrollbar and wrapping of long math output

1,708 views
Skip to first unread message

Bill Page

unread,
May 30, 2017, 5:50:44 PM5/30/17
to sage-devel
I am not sure if this is the right place to ask this question (Perhaps
there is a more specific Jupyter developer list?) but I find the
following behavior rather annoying:

After doing

%display typeset

if do something that generates some long multi-line Sage output,
mathjax seems to do a pretty good job of wrapping the mathematics BUT
I still get a horizontal scrollbar at the bottom of the output area.
This happens regardless of how I have my browser width ans zoom set.
Note: This has nothing to do with the Cell/Current Outputs/Toggle
Scrolling setting. I have that at the default which does not result in
any vertical scrollbar.

The weird thing is that if before generating the output I first
increase the zoom on my browser (Chrome on Linux) to 125%, generate
the output, and then reduce the zoom level back to 100% the math is
wrapped and shown nicely in the output area without the need for a
horizontal scroll bar.

Does anyone know if this has been previously reported to the Jupyter
developers or if this is an artifact of the way Jupyter is
incorporated into Sage? Is there perhaps some css option I can set to
always avoid the horizontal scrollbar (when mathjax wrapping is
possible)? Maybe there is an output area width parameter that should
be smaller than it is by default.

William Stein

unread,
May 30, 2017, 6:30:30 PM5/30/17
to sage-devel
On Tue, May 30, 2017 at 2:50 PM, Bill Page <bill...@newsynthesis.org> wrote:
> I am not sure if this is the right place to ask this question (Perhaps
> there is a more specific Jupyter developer list?) but I find the
> following behavior rather annoying:
>
> After doing
>
> %display typeset
>
> if do something that generates some long multi-line Sage output,
> mathjax seems to do a pretty good job of wrapping the mathematics BUT

What output exactly?

I just tried this with some long output and it did not wrap for me in
Jupyter... or in my recent complete rewrite from scratch of Jupyter
[1]. See screenshots. I wanted to make sure that my rewrite doesn't
have the bug you mentioned (and surely what you're describing is a
bug), since I'm aiming to keep it "bug free".

Please attach screenshots...

[1] http://blog.sagemath.com/jupyter/2017/05/05/jupyter-rewrite-for-smc.html

> I still get a horizontal scrollbar at the bottom of the output area.
> This happens regardless of how I have my browser width ans zoom set.
> Note: This has nothing to do with the Cell/Current Outputs/Toggle
> Scrolling setting. I have that at the default which does not result in
> any vertical scrollbar.
>
> The weird thing is that if before generating the output I first
> increase the zoom on my browser (Chrome on Linux) to 125%, generate
> the output, and then reduce the zoom level back to 100% the math is
> wrapped and shown nicely in the output area without the need for a
> horizontal scroll bar.
>
> Does anyone know if this has been previously reported to the Jupyter
> developers or if this is an artifact of the way Jupyter is
> incorporated into Sage? Is there perhaps some css option I can set to
> always avoid the horizontal scrollbar (when mathjax wrapping is
> possible)? Maybe there is an output area width parameter that should
> be smaller than it is by default.
>
> --
> 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 post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



--
William (http://wstein.org)
Screen Shot 2017-05-30 at 3.28.35 PM.png
Screen Shot 2017-05-30 at 3.28.25 PM.png

Bill Page

unread,
May 30, 2017, 10:06:56 PM5/30/17
to sage-devel
William,

Thanks for this response. You are correct that the problem does not
happen with the new CoCalc version of Jupyter. Look at outputs [10]
and [11] in this worksheet:

https://cocalc.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/HigherOrder.ipynb

Compare it to the attached screenshot taken from SageMath 8.0 beta5
running Jupyter.

Note: If I open this worksheet using the "Plain Jupyter Server" on
CoCalc the same horizontal scrollbars appear as with SageMath running
Jupyter locally.

https://cocalc.com/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/port/jupyter/notebooks/HigherOrder-1.ipynb

Do you happen to recall any specific css related to how Jupyter and
MathJax agree on the width of the output area.

Is the new CoCalc Jupyter interface available in the Docker version?
If so maybe I should just switch to that. Besides the collaboration
functionality, this new version has several other nice things about it
compared to the vanilla version.

Bill Page.
Screenshot from 2017-05-30 21-45-08.png

William Stein

unread,
May 30, 2017, 10:09:32 PM5/30/17
to sage-...@googlegroups.com


On Tuesday, May 30, 2017, Bill Page <bill...@newsynthesis.org> wrote:
William,

Thanks for this response.  You are correct that the problem does not
happen with the new CoCalc version of Jupyter.  Look at outputs [10]
and [11] in this worksheet:

https://cocalc.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/HigherOrder.ipynb

Compare it to the attached screenshot taken from SageMath 8.0 beta5
running Jupyter.

Note: If I open this worksheet using the "Plain Jupyter Server" on
CoCalc the same horizontal scrollbars appear as with SageMath running
Jupyter locally.

https://cocalc.com/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/port/jupyter/notebooks/HigherOrder-1.ipynb

Do you happen to recall any specific css related to how Jupyter and
MathJax agree on the width of the output area.

Is the new CoCalc Jupyter interface available in the Docker version?

Yes!

 
If so maybe I should just switch to that. Besides the collaboration
functionality, this new version has several other nice things about it
compared to the vanilla version.

Please do, and report all bugs or issues.  

 
--
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 post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


--
Sent from my massive iPhone 6 plus.

William Stein

unread,
May 30, 2017, 10:11:02 PM5/30/17
to sage-...@googlegroups.com
Also you can report this jupyter bug (including input to reproduce) to them on github.  They are good at triaging their issues right now....
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscribe@googlegroups.com.

To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


--
Sent from my massive iPhone 6 plus.

Bill Page

unread,
May 30, 2017, 10:15:24 PM5/30/17
to sage-devel
On 30 May 2017 at 22:11, William Stein <wst...@gmail.com> wrote:
> Also you can report this jupyter bug (including input to reproduce) to them
> on github. They are good at triaging their issues right now....
>

I was a bit uncertain as to where to report it since I am using
--notebook=jupyter in sage. I figured that on the github issue list
they might prefer if I was reporting on Jypyter running natively. I
am not sufficiently familiar with this to know if this is really the
same thing.

Bill Page

unread,
May 30, 2017, 10:22:38 PM5/30/17
to sage-devel, sage-cloud-members
On 30 May 2017 at 22:09, William Stein <wst...@gmail.com> wrote:
>
> On Tuesday, May 30, 2017, Bill Page <bill...@newsynthesis.org> wrote:
>>
>> Is the new CoCalc Jupyter interface available in the Docker version?
>
> Yes!
>
>>
>> If so maybe I should just switch to that. Besides the collaboration
>> functionality, this new version has several other nice things about it
>> compared to the vanilla version.
>
> Please do, and report all bugs or issues.
>

This is really a CoCalc question I guess, but is there a way to
implement a 'custom.css' in the CoCalc version of Jupyter? I asked a
similar question early on the Sage list because I wanted to be able to
use

https://github.com/powerpak/jupyter-dark-theme

I have become very accustomed lately to using the dark themes in atom
and now these worksheets seem entirely too bright ... I tried some of
the CoCalc themes but they did not seem to affect the worksheets much.

William Stein

unread,
May 30, 2017, 10:33:55 PM5/30/17
to Bill Page, sage-devel, sage-cloud-members


On Tuesday, May 30, 2017, Bill Page <bill...@newsynthesis.org> wrote:
On 30 May 2017 at 22:09, William Stein <wst...@gmail.com> wrote:
>
> On Tuesday, May 30, 2017, Bill Page <bill...@newsynthesis.org> wrote:
>>
>> Is the new CoCalc Jupyter interface available in the Docker version?
>
> Yes!
>
>>
>> If so maybe I should just switch to that. Besides the collaboration
>> functionality, this new version has several other nice things about it
>> compared to the vanilla version.
>
> Please do, and report all bugs or issues.
>

This is really a CoCalc question I guess, but is there a way to
implement a 'custom.css' in the CoCalc version of Jupyter?  

Definitely not. Cocalc jupyter doesn't even use CSS.  


I asked a
similar question early on the Sage list because I wanted to be able to
use

  https://github.com/powerpak/jupyter-dark-theme

I have become very accustomed lately to using the dark themes in atom
and now these worksheets seem entirely too bright ...  I tried some of
the CoCalc themes but they did not seem to affect the worksheets much.

If you set the editor theme in account settings it will be immediately applied to all input cells.  Currently there is no way to theme the output.  That will change....

 

--
You received this message because you are subscribed to the Google Groups "sage-cloud-members" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cloud-memb...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-cloud-members.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud-members/CAC6x94RGWNAfwnF%2B_vje6pBvB%2B0zKpZtz4%3D9qfXOOpi6DhOgVw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages