Among many settings for a fresh installation I have

CurrentValue[$FrontEnd, ShowGroupOpener] = True

in order to have sections openers always visible.

It does not work in 11.3 anymore. Even weirder, by default:

CurrentValue[$FrontEnd, ShowGroupOpener]
CurrentValue[EvaluationNotebook[], ShowGroupOpener]

"OutsideFrame" (* equivalent to True *)

"Inline" (* the new 'open me only' stuff *)

How could it happen that notebook's setting is different if no explicit options are set for EvaluationNotebook[]?

What is the way to go about ShowGroupOpener now?


1 Answer 1



To set ShowGroupOpener on a global level, previously done by CurrentValue[$FrontEnd, ShowGroupOpener] = True, now use:

CurrentValue[$FrontEnd, {StyleHints, "GroupOpener"}] = "OutsideFrame"

This is what preferences menu does too.

Further explanation

The direct cause is Core.nb / All / Working style which, as a stylesheet setting, comes between the front end and notebook's options.

Cell[StyleData[All, "Working"]
, ...
, ShowGroupOpener->Dynamic[
    If[CurrentValue[{StyleHints, "GroupOpener"}] === Inherited
  , Inherited
  , CurrentValue[{StyleHints, "GroupOpener"}]
, ...

Why StyleHints govern global setting of section's openers? Here is a feedback we received in chat:

The reason for using the StyleHints mechanism is that cell group openers is a place where stylesheets have definite opinions, and we don't want to subvert those opinions. OTOH asking people to edit stylesheets in place of using a preferences dialog isn't very friendly. So the StyleHints mechanism is a way of taking a global opinion about how things should be done and importing it into selective places in the stylesheet.

E.g., think about the times when you might have wanted to change something, but what you really wanted to do was to get 20 styles to obey your global setting while not messing up hundreds of styles you definitely didn't want to touch. A clearer example would be with the "CodeFont" setting. Where you want "code-ish" styles to use the "CodeFont", while other styles maybe should have no opinion at all about fonts (like the "TraditionalForm" style), and should definitely not be inheriting some global setting of, e.g., FontFamily->"Source Code Pro".

All of these styles could have inherited from a common "CodeParent" style, but then you'd have to edit the stylesheet to change it. Whereas now, with StyleHints, you can make it be a global setting that's easily changed from one user's preferences to the next. I think of this as kind of being the "y axis of stylesheets", where the x axis follows normal inheritance rules, but the y axis defines an orthogonal inheritance that you can use to cut across stylesheets in whatever way you choose. I believe old Java programmers would refer to this kind of cross-inheritance cutting as an "aspect".

- J. F.

  • $\begingroup$ Is this method broken again in v14 or earlier?: i.stack.imgur.com/6dzsp.png $\endgroup$
    – xzczd
    Mar 2 at 3:25
  • $\begingroup$ Strangely, the method seems to become effective after a while. (I don't know the exact time... ) $\endgroup$
    – xzczd
    Mar 2 at 6:35
  • $\begingroup$ @xzczd I just installed v14 on a fresh laptop and it worked for me. I didn't track changes to openers in recent versions though so maybe things are different anyway. $\endgroup$
    – Kuba
    Mar 2 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.