Ask Your Question
1

Collapsing cells - comments in directives

asked 13 years ago

Jesustc gravatar image

updated 13 years ago

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!

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
3

answered 13 years ago

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.

Preview: (hide)
link

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 ( 13 years ago )
0

answered 10 years ago

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.

Preview: (hide)
link

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: 13 years ago

Seen: 1,204 times

Last updated: Jul 12 '14