7
$\begingroup$

If I wish to look through a long documentation page (e.g., that for Integrate or Plot), I find it helpful to first expand all the cells. I can then search for what I seek with either a visual scan or a word search. However, expanding all the cells manually is tedious—I have to individually click on each of the separate down-arrows, sub-down-arrows, and sub-sub-down-arrows (the page for Plot has a total of 50 of these!).

Is there a way to do this complete (i.e., recursive) expansion with a single command? On a Mac, in a notebook, you can highlight all the cells with Cmd+A and then toggle back and forth between open and closed with Cmd+'. But this doesn't work in the help docs.

$\endgroup$
9
  • 1
    $\begingroup$ I should probably note that I had modified the stylesheet for doc pages using this answer; I don't actually know if the "Details and Options" in the default stylesheet will expand in the manner I described. $\endgroup$ Mar 29, 2018 at 3:56
  • 1
    $\begingroup$ Yes, it all gets expanded on Linux. And, having tried now, it works on Windows too. $\endgroup$ Mar 29, 2018 at 4:24
  • 3
    $\begingroup$ Cmd+A followed by Cmd+Shift+[ works on OSX for me. $\endgroup$
    – Carl Woll
    Mar 29, 2018 at 4:33
  • 1
    $\begingroup$ Thanks for all your help! I figured out the problem. I've long used cmd + ' to toggle back and forth between expanded and collapsed cells in notebooks (less typing than cmd + shift + [ and cmd + shift + ], plus I don't need to remember that you use a L bracket to open and a R bracket to close). The problem is that cmd + ' doesn't work in the help docs; you have to use cmd + shift + [ . Sorry to take up your time! Should I put the correction in the original question, add it as an answer, or delete the question? [I'll do the first in the meantime.] $\endgroup$
    – theorist
    Mar 29, 2018 at 5:01
  • 1
    $\begingroup$ @theorist just self-answer. Better than having it in the question. $\endgroup$
    – b3m2a1
    Mar 29, 2018 at 5:02

2 Answers 2

10
$\begingroup$

While (on a Mac) Cmd+' works to toggle cell groups open and closed in notebooks, it doesn't work in the help documentation. There you have to instead use Cmd+Shift+[ (or, in Windows or Linux, Ctrl+Shift+[ ).

So to get it to work on all of the groups use Cmd/Ctrl+A then Cmd/Ctrl+Shift+[

$\endgroup$
3
  • $\begingroup$ This should be the accepted answer. It's superior to mine and more direct. If you mark it as such it'll percolate up higher and people won't see mine first. $\endgroup$
    – b3m2a1
    Mar 29, 2018 at 5:49
  • 2
    $\begingroup$ Thanks; since it's a self-answer, the system won't allow me to accept it for two days. $\endgroup$
    – theorist
    Mar 29, 2018 at 5:56
  • $\begingroup$ @b3m2a1 Also, as it's a self-answer, it won't be sent to the top if accepted. $\endgroup$
    – wizzwizz4
    Mar 29, 2018 at 12:56
8
$\begingroup$

Here's a way to do it programmatically in case that's ever useful:

FrontEndExecute@{FrontEndToken[InputNotebook[], "SelectAll"],
  FrontEndToken[InputNotebook[], "SelectionOpenAllGroups"]}

Or you can bind it to a button:

Button["Open Groups", 
 FrontEndExecute@{FrontEndToken[InputNotebook[], "SelectAll"], 
   FrontEndToken[InputNotebook[], "SelectionOpenAllGroups"]}
 ]

You could also bind it to the basic Cmd+' event:

{
 {"MenuCommand", 
   "OpenCloseGroup"} :> {FrontEndToken[InputNotebook[], "SelectAll"], 
   FrontEndToken[InputNotebook[], "SelectionOpenAllGroups"]}
 }

Attach that to the NotebookEventActions at the stylesheet level for the "Wolfram/Reference.nb" stylesheet (making sure to make a copy in your $UserBaseDirectory to edit).

$\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.