delete output of selected cells? how to select cells?

103 views
Skip to first unread message

Dan Drake

unread,
Apr 15, 2015, 11:04:26 AM4/15/15
to sage-cloud
There are three buttons in SMC -- toggle display of input/output of
selected cells, and delete output of selected cells. But I don't know
how to use them...because I don't know how to select cells.

I can ctrl-click to create multiple cursors, but when I do that, only
the last cell is affected.

Also, I can toggle display of input...but how do I get it back? I have a
worksheet where I can see the bar in line 51, then it skips right to 55,
and I can't select the cell. (There's no output.)

Actually, for a cell with hidden input and no output, I can randomly
click on the bars to create empty cells above and below, then drag to
highlight those cells (including the hidden one), and then click "toggle
input" *twice*, and I get the hidden cell back.

How do I select multiple cells? And how do I select cells with hidden
input and no output?

Thanks.

Dan

--
--- Dan Drake
----- www.math.wisc.edu/~ddrake/
-------
signature.asc

Dan Drake

unread,
Apr 15, 2015, 11:08:07 AM4/15/15
to sage-cloud
Aaaaand, as usual I figure out something immediately after sending. But
it's not quite what I want:
https://groups.google.com/d/topic/sage-cloud/yVjR41qKUKI/discussion

You can just drag to select a bunch of cells...but what I frequently
have are compute cells alternating with Markdown cells, because I'm
writing a worksheet that I'm going to show my students. So if I select
everything and delete the output, I'm also deleting the output of the
Markdown cells, which I don't want.

So: how to select non-contiguous cells? Is there something better than
clicking in each cell and deleting its output?
signature.asc

William Stein

unread,
Apr 15, 2015, 11:08:30 AM4/15/15
to sage-cloud
On Wed, Apr 15, 2015 at 8:04 AM, Dan Drake <ddr...@math.wisc.edu> wrote:
> There are three buttons in SMC -- toggle display of input/output of
> selected cells, and delete output of selected cells. But I don't know
> how to use them...because I don't know how to select cells.

Codemirror and many (all?) other editors have a notion of the current
selection, which is a range of text that is selected -- it's
highlighted in a different color usually, and if you hit copy (say),
then it gets copied into the copy buffer. (Until recently it was
contiguous, but multiple selections are now allowed.)

A cell is selected if and only if it is contained in the current
selection... though ignore multiple selections, since I probably need
to update some relevant code to support them, as they were added to
codemirror only recently.

>
> I can ctrl-click to create multiple cursors, but when I do that, only
> the last cell is affected.
>
> Also, I can toggle display of input...but how do I get it back? I have a
> worksheet where I can see the bar in line 51, then it skips right to 55,
> and I can't select the cell. (There's no output.)

Double click the output if there is any, or make sure the input you
want to display is contained in the selection, then click the button.

>
> Thanks.
>
> Dan
>
> --
> --- Dan Drake
> ----- www.math.wisc.edu/~ddrake/
> -------
>
> --
> 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/20150415150425.GA27963%40math.wisc.edu.
> For more options, visit https://groups.google.com/d/optout.



--
William Stein
Founder/CEO of SageMath, Inc. (http://sagemath.com)
206-419-0925

Harald Schilly

unread,
Apr 15, 2015, 11:21:40 AM4/15/15
to sage-...@googlegroups.com
On Wed, Apr 15, 2015 at 5:04 PM, Dan Drake <ddr...@math.wisc.edu> wrote:
> ...because I don't know how to select cells.

"Ctrl-a" does select all cells, maybe it helps a bit.

-- h

William Stein

unread,
Apr 15, 2015, 11:56:09 AM4/15/15
to sage-cloud
What you *should* do is alt (or command on mac) click on each cell
where you want to hide, then click the "delete output" button.
However, that doesn't work at this very moment, since I implemented it
before there were multiple selections. The fix is probably 2 or 3
lines just changing getting the selection to iterating over multiple
selections. Even if I do this, it seems like this would be pretty
annoying since you still have to click a bunch of times.

With sublime editor shortcuts selected, you can also do a search for
some pattern, then hit control-d multiple times to put the cursor at
the results matching the search.

Another option would be to write a Python script to process the
worksheet, then run it. The file

~/.sagemathcloud/sagews2pdf.py

is basically a Python parser for worksheets -- it could load the
worksheet, do anything you want programmatically, then save the
worksheet. If the worksheet is saved to disk, then the updated state
will be displayed automatically in the UI within 5 seconds.

A final option would be a similar parser (and plugin mechanism) that
operates client side at the Javascript level...

I think the Python script option is pretty nice though. It would make
it easy to do sophisticated processing to a document in Python itself,
which would be very useful in general.


>
>
>
>
> Dan
>
> --
> --- Dan Drake
> ----- www.math.wisc.edu/~ddrake/
> -------
>
> --
> 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/20150415150806.GB27963%40math.wisc.edu.

singlets

unread,
Apr 15, 2015, 7:50:31 PM4/15/15
to sage-...@googlegroups.com


On Wednesday, April 15, 2015 at 10:56:09 AM UTC-5, William Stein wrote:
On Wed, Apr 15, 2015 at 8:08 AM, Dan Drake <ddr...@math.wisc.edu> wrote:
> Aaaaand, as usual I figure out something immediately after sending. But
> it's not quite what I want:
> https://groups.google.com/d/topic/sage-cloud/yVjR41qKUKI/discussion
>
> You can just drag to select a bunch of cells...but what I frequently
> have are compute cells alternating with Markdown cells, because I'm
> writing a worksheet that I'm going to show my students. So if I select
> everything and delete the output, I'm also deleting the output of the
> Markdown cells, which I don't want.


This is a useful feature for classroom use...a button/keyboard shortcut that deletes all *output* cells, leaving (rendered) markdown, code cells intact. No selecting necessary. Don't know if sagews has any notion of a cell 'type' tho...


Another option would be to write a Python script to process the
worksheet, then run it.  The file

  ~/.sagemathcloud/sagews2pdf.py

is basically a Python parser for worksheets -- it could load the
worksheet, do anything you want programmatically, then save the
worksheet.  If the worksheet is saved to disk, then the updated state
will be displayed automatically in the UI within 5 seconds.

I think the Python script option is pretty nice though.  It would make
it easy to do sophisticated processing to a document in Python itself,
which would be very useful in general.

If I'm understanding this, it would be very handy...one simple example: a single sagews could work like a LaTeX doc using version.cls or exam.cls.  Both the student version and the key are derived from a single document.

Steve
 
Reply all
Reply to author
Forward
0 new messages