0
$\begingroup$

I want to accomplish two things:

  1. Be able to minimize long function definitions and other blocks of code. To this end, I grouped each such block with a Text-style title that I can double-click to open or close the block. Other styles, like Chapter or Subsection, seemingly have a will of their own and do all kinds of crazy things - make one big group of all cells in the notebook, fail to respond to "Ungroup Cells", re-absorb cells that I try to move out of the group - so I avoid those.

  2. Have one second-level group of all the block+title groups, so that I can select and evaluate it. "Group Cells" doesn't work here - it just merges the cells together instead of grouping them.

I think I'm supposed to use the other styles to accomplish this, but I don't know how to get them to behave.

$\endgroup$

1 Answer 1

1
$\begingroup$

It is important to note that their is a hierarchy of the different text cells (Title, subtitle, etc...). A Title will group everything below it except for another Title. A Subtitle will group everything below it until another Title or Subtitle is encountered and so on. The ordering goes Title>Subtitle>Chapter>Section>Subsection>Subsubsection.

Any of these sections described above can be used to group cells. For example if you had a Title with several code lines after it, you could select the bar to the right of all the code cells and title and execute and it would run all of the code cells in that group.

Hopefully this helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.