12

Is there some way to keep the (new in v11.3) cell group opener button:

enter image description here

So I can use it to close the group?

enter image description here

Such a feature/hack would be nice as it takes me more effort to find the exact tiny vertical line to click on in the cell grouping outlines (on the right of the notebook).

Kuba
  • 136,707
  • 13
  • 279
  • 740
M.R.
  • 31,425
  • 8
  • 90
  • 281
  • 2
    That was my immediate thought as soon as I saw this new feature. Of course when the group is open, the icon should change to a left-pointing chevron-like icon. Trying to find the correct cell bracket to close an open group was always harder and error prone than finding the bracket to open a closed group. – murray Apr 10 '18 at 14:04

2 Answers2

4

Automatic closer is not there but it is on a todo list:

An inline closer is coming in the next version per popular request. The thinking was that it might be ugly/annoying to have closers everywhere, but the current plan is to only show closers on groups where you opened them with the openers. That plan may or may not survive the fire of testing.

- John Fultz in chat

Meanwhile you can create a custom one:

How to change the appearance of a Cell GroupOpener?

or use the old one, called "OutsideFrame" now:

ShowGroupOpener's mess in 11.3

Kuba
  • 136,707
  • 13
  • 279
  • 740
  • You can get at the function that attaches these via Block[{$Context = "FE`"}, FrontEndResource["FEExpressions", "cellGroupOpenerInline"]] I've update the AttachedCell part of https://mathematica.stackexchange.com/a/133523/38205 to reflect what I saw there – b3m2a1 Apr 17 '18 at 08:37
  • Using "OutsideFrame" in the OptionInspector/ShowGroupOpener I noticed that it only works for "SelectedNotebooks" but does not work when I choose "GlobalPreferences". I use Win7, 11.3 – Alexei Boulbitch Apr 17 '18 at 09:22
  • @AlexeiBoulbitch Yes, that is exactly the problem in the question linked at the bottom. With Options Insector you switch a specific option. With preferences menu you change a labeled feature but it is not clear what is going on underneath. – Kuba Apr 17 '18 at 09:26
  • 1
    Now in version 12.0 we have the new inline openers/closers described by John Fultz. – Alexey Popkov Oct 16 '19 at 13:49
1

Here's a way to manually get a closer like the opener (seemingly does not work on Windows):

attachGroupCloser =
  Block[{$Context = "FE`"}, 
    FrontEndResource["FEExpressions", "cellGroupOpenerInline"]] /.
   {
    Open -> Closed,
    "CellGroupOpened" -> "CellGroupClosed"
    };
FrontEndExecute@attachGroupCloser[NextCell[]];

There are surely ways to get this to bind at the stylesheet level, but it doesn't even matter as this is far from ready for primetime:

blah

(note the excess whitespace)

Here's an explicit example:

CellPrint@
  Cell[
   CellGroupData[
    {
     Cell["Close me", "Subsubsection"],
     Cell["goodbye cruel notebook", "Text"],
     Cell["I'll disappear too!", "Text"]
     }
    ]
   ];
FrontEndExecute@attachGroupCloser[NextCell[]];
b3m2a1
  • 46,870
  • 3
  • 92
  • 239