Wolfram Computation Meets Knowledge

OpenCellGroups

Contributed by: Richard Hennigan (Wolfram Research)

Open cell groups in a notebook by style

ResourceFunction["OpenCellGroups"][]

opens the cell groups from a predefined set of styles in the current notebook.

ResourceFunction["OpenCellGroups"][style]

opens the cell groups in the current notebook that match the style specification style.

ResourceFunction["OpenCellGroups"][notebook,style]

opens the cell groups in notebook that match the style specification style.

Details and Options

OpenCellGroups allows you to open only the cell groups in a notebook that have a particular style. For example, this allows you to open all the Section groups while leaving Subsections unchanged.
The style specification can be given as a string, pattern, or list of cell styles.

Examples

Basic Examples

Open an example notebook for testing:

In[1]:=
nb = NotebookPut[
   Import[FindFile["ExampleData/document.nb"]] /. Open -> Closed];
Out[1]=

Open all the Section groups:

In[2]:=
ResourceFunction["OpenCellGroups"][nb, "Section"];
Out[2]=
In[3]:=
NotebookClose[nb];

More Examples

Scope

Retrieve the function:

In[4]:=
ResourceFunction["OpenCellGroups"]
Out[4]=

Retrieve the resource:

In[5]:=
ResourceObject["OpenCellGroups"]
Out[5]=

Resource History