notebook hack of the day

105 views
Skip to first unread message

William Stein

unread,
May 11, 2012, 6:08:33 PM5/11/12
to sage-notebook, sage-devel
Hi,

Have you ever given a presentation with the Sage notebook and been
annoyed by it "jumping all over the place" when you press shift-enter
or click "evaluate"? Then do:

html('<script>cell_focus=function(x,y){} </script>')


--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Christopher Swenson

unread,
May 11, 2012, 6:13:17 PM5/11/12
to sage-...@googlegroups.com, sage-notebook

Great tip!

I also recommend you make sure everything works under zoom and at 1024x768.

--
To post to this group, send an email to sage-...@googlegroups.com
To unsubscribe from this group, send an email to sage-devel+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

William Stein

unread,
May 11, 2012, 6:17:06 PM5/11/12
to sage-...@googlegroups.com, sage-notebook
On Fri, May 11, 2012 at 6:13 PM, Christopher Swenson <vad...@gmail.com> wrote:
> Great tip!
>
> I also recommend you make sure everything works under zoom and at 1024x768.
>

That's different and important new development work. The hack below
was something I figured out because I was about to blow chunks while
trying to watch some presentations given using the Sage notebook this
week... and I have a high tolerance for disorienting motion.

Christopher Swenson

unread,
May 11, 2012, 6:20:03 PM5/11/12
to sage-...@googlegroups.com, sage-notebook

Sorry. I wasn't clear. I meant when giving talks, you should make sure you have tried those things. The notebook tends to work fine, but you need to be careful about long lines and big images. :)

Jason Grout

unread,
May 11, 2012, 7:05:30 PM5/11/12
to sage-...@googlegroups.com
On 5/11/12 5:17 PM, William Stein wrote:
> and I have a high tolerance for disorienting motion.

(assuming you meant "intolerance")....And you *skateboard*???

Jason


P Purkayastha

unread,
May 12, 2012, 3:53:21 AM5/12/12
to sage-...@googlegroups.com, sage-notebook
Dima had created a button for it, which said "Evaluate and stay" just next to the "Evaluate" button. It stopped the worksheet from jumping around. Maybe he can tell you in detail how he achieved that. :)

Florent Hivert

unread,
May 12, 2012, 9:59:55 AM5/12/12
to sage-...@googlegroups.com
On Fri, May 11, 2012 at 06:08:33PM -0400, William Stein wrote:
> Hi,
>
> Have you ever given a presentation with the Sage notebook and been
> annoyed by it "jumping all over the place" when you press shift-enter
> or click "evaluate"? Then do:
>
> html('<script>cell_focus=function(x,y){} </script>')

Cool ! At the Sage Days 38 we have been doing a lot of tutorial using notebook
with a lot of text at this is extremely annoying. Too bad we learn of it right
after the Days. By the way, half a dozen of those tutorials should be
contributed to Sage in a short amount of time (they needs some cleanup and
polishing). Among them:
- Basic Python programming;
- Basic Cython programming;
- Combinatorics;
- Contributing to Sage;
- Testing conjecture in Parallel;
...
Cheers,

Florent

Nicolas M. Thiery

unread,
May 14, 2012, 6:14:39 AM5/14/12
to sage-...@googlegroups.com
On Sat, May 12, 2012 at 03:59:55PM +0200, Florent Hivert wrote:
> Cool ! At the Sage Days 38 we have been doing a lot of tutorial using notebook
> with a lot of text at this is extremely annoying. Too bad we learn of it right
> after the Days. By the way, half a dozen of those tutorials should be
> contributed to Sage in a short amount of time (they needs some cleanup and
> polishing). Among them:
> - Basic Python programming;
> - Basic Cython programming;
> - Combinatorics;
> - Contributing to Sage;
> - Testing conjecture in Parallel;
> ...

For the end result:

http://combinat.sagemath.org/doc/thematic_tutorials/index.html

For the sources:

http://combinat.sagemath.org/code/file/tip/doc/en/thematic_tutorials/

Cheers,
Nicolas
--
Nicolas M. Thi�ry "Isil" <nth...@users.sf.net>
http://Nicolas.Thiery.name/

P Purkayastha

unread,
May 14, 2012, 1:22:31 PM5/14/12
to sage-...@googlegroups.com, Nicolas M. Thiery


On Monday, May 14, 2012 6:14:39 PM UTC+8, Nicolas M. Thiéry wrote:
On Sat, May 12, 2012 at 03:59:55PM +0200, Florent Hivert wrote:
> Cool ! At the Sage Days 38 we have been doing a lot of tutorial using notebook
> with a lot of text at this is extremely annoying. Too bad we learn of it right
> after the Days. By the way, half a dozen of those tutorials should be
> contributed to Sage in a short amount of time (they needs some cleanup and
> polishing). Among them:
>  - Basic Python programming;
>  - Basic Cython programming;
>  - Combinatorics;
>  - Contributing to Sage;
>  - Testing conjecture in Parallel;
>  ...

For the end result:

        http://combinat.sagemath.org/doc/thematic_tutorials/index.html

For the sources:

        http://combinat.sagemath.org/code/file/tip/doc/en/thematic_tutorials/

Thanks! The cython tutorial is very interesting. I always wondered how to handle for loops and lists. 

Cheers,
                                Nicolas
--
Nicolas M. Thi�ry "Isil" <nth...@users.sf.net>
http://Nicolas.Thiery.name/

Nils Bruin

unread,
May 14, 2012, 3:52:44 PM5/14/12
to sage-devel
On May 14, 3:14 am, "Nicolas M. Thiery" <Nicolas.Thi...@u-psud.fr>
wrote:
> >  - Contributing to Sage;

I noticed some minor typos, but in

http://combinat.sagemath.org/doc/thematic_tutorials/tutorial-editing-sage-sources.html#a-real-modification

there's a serious one (Section 4): It still has the wrong editing
command there:

gedit /opt/sage/local/lib/python2.6/site-packages/sage/combinat/
permutation.py

which will really confuse people. Perhaps suggest using the "edit"
command instead? That will do the required path substitution.
Reply all
Reply to author
Forward
0 new messages