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?
Asked
Active
Viewed 1,088 times
8
1 Answers
3
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.
murray
- 11,888
- 2
- 26
- 50
-
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 02: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 '14 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 '14 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 '14 at 20:31
-
@Ben Allgeier: Which version of Mathematica are you using? I'm using 10. – murray Jul 21 '14 at 00:26
-
@murray, I am using 10 also. I may have misunderstood when you said the evaluated input cell. What I tried before was just applying ShowGroupOpener on the Input cell by itself (or the output cell by itself). But if I apply it to the group, and then double-click the output cell, the GroupOpener appears on the output. However, when you open the group, the GroupOpener is on the Input cell. So it seems that you can not get the GroupOpener to stay on the Output Cell when the group is opened, unlike the Input Cell. – Ben Allgeier Jul 21 '14 at 15:27
-
@Ben Allgeier: Right! You apply the GroupOpener to the Input/Output group after you evaluate the Input cell. If you double-click the Output cell it hides the Input cell but leaves the GroupOpener on the Output cell. But then when you open the group, the GroupOpener appears as if on the Input cell -- really on the whole group, which always means the first cell within the group. Thus this seems to achieve what you originally asked: display only the Output but have the GroupOpener displayed as a way to display the Input too. – murray Jul 21 '14 at 19:10
-
@murray, Thanks. It does do the main thing I wanted, which is to put a GroupOpener on the Output Cell. Applying this to the Output Cell has the same effect when the group is closed. The only other thing I was wanting was the GroupOpener to stay on the Output Cell even when the group is opened (which is what happens to the Input Cell when you apply this to the Input Cell). But this definitely helps. – Ben Allgeier Jul 21 '14 at 19:45
CellPrint[Cell["", "Section", ShowGroupOpener -> True]]– JOwen Jan 19 '12 at 13:36SetOptions[EvaluationNotebook[], {"ShowGroupOpener" -> True}]orSetOptions[EvaluationNotebook[], ShowGroupOpener-> True]– kglr Jan 19 '12 at 13:44