Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I currently edit manually the cell contents of a notebook (Ctrl+Shift+A or Cmd+Shift+A) to "recycle" cells containing the ShowGroupOpener option. Is there an easier way to create documents hiding contents under that type of icon?

share|improve this question
2  
It is not clear to me what you mean by "recycle" cell with ShowGroupOpener. For the second part of your question do you want all grouped cells in your notebook that have a ShowGroupOpener to be closed by default (or via some straight forward method)? –  Mike Honeychurch Jan 19 '12 at 11:05
    
Ruben, I am not sure what exactly your question is, but are you aware that you can generate a cell that will show the group opener as follows? CellPrint[Cell["", "Section", ShowGroupOpener -> True]] –  JOwen Jan 19 '12 at 13:36
1  
Ruben and @JOwen, you can also do the same for the entire notebook using SetOptions[EvaluationNotebook[], {"ShowGroupOpener" -> True}] or SetOptions[EvaluationNotebook[], ShowGroupOpener-> True] –  kguler Jan 19 '12 at 13:44

1 Answer 1

up vote 2 down vote accepted

Unless you want group openers for all groups -- which you probably don't, since that would put one at the very top level for the entire notebook -- then you can edit the notebook's style sheet, select the kind of cell (Section, Subsection, e.g.) for which you want the group opener, and then use the Option Inspector on that cell in the style sheet to include ShowGroupOpener.

You could do this either for a particular notebook by using the menu command Format > Edit StyleSheet or you could make a copy of a standard style sheet, modify that, and then select it as the style sheet for whatever notebooks you choose. (I'd advise against directly modifying any of the Wolfram-supplied style sheets.)

I can give a more detailed explanation if you like.

share|improve this answer
    
Hi Murray. Thanks a lot for the explanation. That was actually what I was looking for. By the way, do you know of any tutorial about how to properly create styles and long documents using Mathematica? –  Ruben.Garcia Jan 27 '12 at 2:58
    
How do you add ShowGroupOpener to an Output cell? I can only apply it to an Input Cell. Sometimes I want to hide the input. –  Ben Allgeier Jul 18 at 15:44
    
Apply the ShowGroupOpener option to the (evaluated) Input cell. Then double-click the Output cell; that will close the group, leaving just the Output cell visible. But the GroupOpener will now appear on that Output cell. When you open the group, the GroupOpener will instead appear on the Input cell. –  murray Jul 19 at 17:11
    
@murray, when I do that and double-click on the output cell, the GroupOpener does not show. It only shows on the Input cell when the group is opened. However, if I apply the ShowGroupOpener option the output cell, the GroupOpener shows on the output cell when the group is closed (which is the most important thing that I wanted here), but it does not show when the group is closed, which is unlike the case when you apply the ShowGroupOpener option to the input cell and have the group opened. I would like the GroupOpener to show both when closed and open as is the case for the Input. –  Ben Allgeier Jul 20 at 20:31
    
@Ben Allgeier: Which version of Mathematica are you using? I'm using 10. –  murray Jul 21 at 0:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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