Ask Your Question
1

Collapsing cells - comments in directives

asked 2011-05-19 10:11:38 +0100

Jesustc gravatar image

updated 2011-05-19 16:35:21 +0100

niles gravatar image

Dear all,

I know that with the directive '%hide' at the beginning of a cell it can be collapsed. It is useful, but it would be much more if I could see something else from the collapsed cell, in addition to the '%hide'. So, is there any trick?

Putting a comment in the first line and the '%hide' in the second does not work, neither putting a comment in the same line that '%hide'.

Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2011-05-19 12:22:17 +0100

niles gravatar image

If what you want to see is some kind of comment about what is in the cell, you could add a text cell just before or after the hidden cell. You can make one of these with <shift>+click between cells. For more details about what kinds of cells you can make, and how to do so, take a look at the keyboard shortcuts for the notebook, found by clicking the "Help" link at the top of each notebook page.

edit flag offensive delete link more

Comments

Thanks a lot! That is what I was finally doing, except for using a text cells (commentaries, instead). But I am moving to text cells: they look nicer.

Jesustc gravatar imageJesustc ( 2011-05-19 20:11:35 +0100 )edit
0

answered 2014-07-12 19:35:14 +0100

I know this is a pretty bad necro, but I have found this really useful and wanted to note: If you do something like;

Whatever(Whatever, Whatever)

%hide print("Hello World")

It will hide Whatever but still has the output "Hello World" because it isn't hidden. If you evaluate the cell it hides the input. If you want to show the input again, just double click on it. Hope I helped you and other stumblers.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-05-19 10:11:38 +0100

Seen: 1,141 times

Last updated: Jul 12 '14