line numbers in a sage worksheet

44 views
Skip to first unread message

valer...@gmail.com

unread,
Feb 1, 2017, 5:18:05 PM2/1/17
to sage-cloud
I do not quite understand the line numbers. I have done some search but have not been able to find this discussed. When I create a new sage worksheet in SMC I see two line numbers on the left, one grey on the left and one blue. If I type for example 2+3 and shift enter, I then see five grey line numbers on the left, numbered 1-5, and on the right there is only the number 1 in blue for the input 2+3, and then the output 5 is on a line  that can be opened and closed by clicking on an arrow (with no number), and then there is a new input cell numbered 1 (blue) corresponding to the 5 in grey.  I would like to know where I could find some explanation of how the input/output cells are organized and numbered.
Thanks for any help.

Samuel Lelièvre

unread,
Feb 1, 2017, 8:33:51 PM2/1/17
to sage-cloud


Wed 2017-02-01 23:18:05 UTC+1, valer...@gmail.com:
I do not quite understand the line numbers. I have done some search
but have not been able to find this discussed.

Have you tried searching this list (sage-cloud) for [line numbers]?

William Stein

unread,
Feb 1, 2017, 8:46:12 PM2/1/17
to sage-cloud
The first column of line numbers are global across the entire
worksheet. The second column of numbers are local to that "input
cell", i.e., the part of the worksheet that will be evaluated when you
press shift+enter. Try evaluating a few more times to see how this
works.

William

> Thanks for any help.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cloud" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-cloud+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cloud/a1b26a8e-8dc2-4c04-918a-e1328e003632%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Best Regards,
William Stein

CEO, SageMath, Inc.

valer...@gmail.com

unread,
Feb 1, 2017, 8:57:22 PM2/1/17
to sage-cloud
oh ok, I see how it works now...it's rather cool actually. What had escaped me was that I could put several lines on the same input cell by typing enter without the shift....thanks for the help and sorry for the rather simple minded question...

William Stein

unread,
Feb 1, 2017, 8:59:01 PM2/1/17
to sage-cloud
On Wed, Feb 1, 2017 at 5:57 PM, <valer...@gmail.com> wrote:
> oh ok, I see how it works now...it's rather cool actually. What had escaped
> me was that I could put several lines on the same input cell by typing enter
> without the shift....thanks for the help and sorry for the rather simple
> minded question...

No problem. Thanks for saying "it's rather cool", since I designed
and implemented this 2-level line numbering system fairly recently.
Enjoy!

William
> https://groups.google.com/d/msgid/sage-cloud/e1b1bc1c-d794-4c73-b5d8-9e1b3bc2dfef%40googlegroups.com.

William Stein

unread,
Feb 1, 2017, 8:59:50 PM2/1/17
to sage-cloud
On Wed, Feb 1, 2017 at 5:58 PM, William Stein <wst...@sagemath.com> wrote:
> On Wed, Feb 1, 2017 at 5:57 PM, <valer...@gmail.com> wrote:
>> oh ok, I see how it works now...it's rather cool actually. What had escaped
>> me was that I could put several lines on the same input cell by typing enter
>> without the shift...

In fact, it's a full text editor. You can also put things like

%r

or

%latex

at the top of a cell, and then the whole cell is evaluated using R (or
LaTeX), etc...

valer...@gmail.com

unread,
Feb 1, 2017, 9:01:28 PM2/1/17
to sage-cloud
I had tried that but with no results...

William Stein

unread,
Feb 1, 2017, 10:25:02 PM2/1/17
to sage-cloud
On Wed, Feb 1, 2017 at 6:01 PM, <valer...@gmail.com> wrote:
> I had tried that but with no results...

Wow, you were right! That was a bug, which I've just fixed due to you
reporting it. Please try again now, and you'll see this:



- Wiliam
Screen Shot 2017-02-01 at 7.24.28 PM.png

valer...@gmail.com

unread,
Feb 2, 2017, 5:38:22 AM2/2/17
to sage-cloud
I had in fact tried the %latex command last night after your post and I could not get it to work, and I had resolved to write to you in the morning about it, then I had sent a quick reply to another post suggesting that I search the forum for the line numbers question, so my comment was actually intended to say I had no results from that search....however, I will take the credit for reporting a bug that I had intended to report the following morning...:):)

I like the %latex feature a lot and I checked that one can also make \newtheorem definitions at the beginning and it will work (apparently the first line  containing %latex should have nothing else for it to work).
But I could not get the $ and $$ buttons to work in the palette that appears after typing %latex 

William Stein

unread,
Feb 2, 2017, 8:33:34 AM2/2/17
to sage-cloud
On Thu, Feb 2, 2017 at 2:38 AM, <valer...@gmail.com> wrote:
> I had in fact tried the %latex command last night after your post and I
> could not get it to work, and I had resolved to write to you in the morning
> about it, then I had sent a quick reply to another post suggesting that I
> search the forum for the line numbers question, so my comment was actually
> intended to say I had no results from that search....however, I will take
> the credit for reporting a bug that I had intended to report the following
> morning...:):)

Thanks again! The underlying images had null bytes in them, which
was confusing some very new code (which then truncated the images).

The %latex mode really does run full latex, so you can 100% do
anything you could in latex (see docs). You can also use %md for
markdown, and use any latex formulas in there, which looks nice. You
can also click a triangle to the left of the input to hide the input.

>
> I like the %latex feature a lot and I checked that one can also make
> \newtheorem definitions at the beginning and it will work (apparently the
> first line containing %latex should have nothing else for it to work).
> But I could not get the $ and $$ buttons to work in the palette that appears
> after typing %latex

That's https://github.com/sagemathinc/smc/issues/1565 and we obviously
better fix that soon.

We also have a full latex editor environment -- just make a new file
with the extension .tex to see it.

-- William

>
>
>
>
> On Wednesday, February 1, 2017 at 9:25:02 PM UTC-6, William Stein wrote:
>>
>> On Wed, Feb 1, 2017 at 6:01 PM, <valer...@gmail.com> wrote:
>> > I had tried that but with no results...
>>
>> Wow, you were right! That was a bug, which I've just fixed due to you
>> reporting it. Please try again now, and you'll see this:
>>
>>
>>
>> - Wiliam
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cloud" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-cloud+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cloud/e08e09e0-9c73-4e37-b6d0-8fda36236c62%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages