14
$\begingroup$

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?

$\endgroup$
14
$\begingroup$

TL;DR;

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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