# Mathematica outliner's capabilities

As my notebooks get larger, I often try to organize them with titles/subtitles etc, structuring them as an outliner (http://en.wikipedia.org/wiki/Outliner)

This also helps me as I try to structure a notebook trying to produce an article, see http://reference.wolfram.com/mathematica/tutorial/NotebooksAsDocuments.html

Unfortunately, I find that Mathematica's outliner capabilities are not so developed... a major source of irritation is that the markers indicating closed groups are very hard to see, and so small I often click on the wrong bracket level trying to open/close them. For me the ideal way would be a doubleclick on the block header to open/close it.

Also, it is not easy at all to take a block and shift it upper or lower in a hierarchy of levels.

Do you know if there is a way to enhance M's capabilities in this field? Maybe through some specialized stylesheet?

(edit ------)

I see by the help you are kindly offering that there is indeed some way to enhance the outliner capabilities - so to rise the bar a bit, knowing that this is a typical outliner feature:

do you know a way to ask your notebook to "show everything down to level x" - that is e.g. keep anything under the level Subsection (or Subsubsection, or ...) closed?

-
Are you aware of Preferences->Show open/close icon for cell groups? This will display group icons on the left side of the notebook. –  Yves Klett Jun 12 at 7:36
And then then there is SystemWholeCellGroupOpener: mathematica.stackexchange.com/a/812/131 –  Yves Klett Jun 12 at 8:04
WholeCellGroupOpener is used on the docs. You click the label e.g., examples and it opens and closes –  Mike Honeychurch Jun 12 at 8:07
@Yves about the pref: thank you, that was new for me! –  alessandro Jun 12 at 9:22

## 2 Answers

I think what you need is to set WholeCellGroupOpener->True for the parts of your notebook that you want to open and close by clicking. This is the option that controls that behaviour in the docs.

For what you are wanting you probably should make this an option in a custom stylesheet for sections and subsections etc.

You can also make buttons and use them as Section/Subsection headings etc.

CellPrint@ExpressionCell[Button[Style["Subsection Name", "Subsection"],
SelectionMove[SelectedNotebook[], All, ButtonCell];
FrontEndExecute[{FrontEndToken["OpenCloseGroup"]}];
SelectionMove[SelectedNotebook[], All, CellGroup],
Appearance -> None
], "Subsection"]
`

If you evaluate and take the output and stick it in a notebook it will open and close the group when you click on the name. Do likewise for Sections and any other type of cell that you want to have this functionality.

-
Answer would be even better with a small screencast of the effect. –  Yves Klett Jun 12 at 8:12
@YvesKlett don't know how to make animated gifs and need to finish for the day soon. –  Mike Honeychurch Jun 12 at 8:45
The WholeCellGroupOpener has been a wonderful discovery, thanks! The only prob I have with it is that I'm unable to move my insertion point around: as soon as I click anywhere, it open/closes the group (probably it would have been better if it reacted to dblclicks) –  alessandro Jun 12 at 9:18
also, any groups having this property are virtually unselectable (to select them you have to click on them), so I cannot find a way e.g. to move them around –  alessandro Jun 12 at 9:28

You can enable the "Show open/close icon for cell groups" in the Preferences menu, which displays controls on the left side of section headings. This is quite handy compared to the fiddly brackets (mind you, larger/customizable control icons would be a good thing, too).

-
Kett I would say that the design of the group opener should be accessible to the author. Recently I discussed here this question, but it appears that nobody knows the way to do that. –  Alexei Boulbitch Jun 12 at 11:06
@AlexeiBoulbitch do you have a link (or was it in chat?). That would be really quite useful a feature! –  Yves Klett Jun 12 at 11:11
@AlexeiBoulbitch AFAIK the group opener is part of the operating system rather than belonging to Mathematica. –  Mike Honeychurch Jun 12 at 20:11
@Yves Klett It was a question here: mathematica.stackexchange.com/questions/46082/…. I think that the comment of Mike Honeychurch above looks like the answer. However, there is an option in the OptionInspector defining the appearance of the GroupOpener. It is gray by default, though it is blue in Win7. –  Alexei Boulbitch Jun 13 at 11:59