1

If I set the value of "WholeCellGroupOpener" to True, the cell with "Input" CellStyle can be folded with a mouse click. I wonder if there is a way that we can set "WholeCellGroupOpener" only for cells that have "Section" or "Chapter" CellStyle, and not be working for "Input" CellStyle.

I've tried "WholeCellGroupOpener" -> If[CellStyle[] != "Input", True, False], but it didn't work.

Domen
  • 23,608
  • 1
  • 27
  • 45
Rudy Yan
  • 23
  • 3

1 Answers1

4

WholeCellGroupOpener can be set per cell, not only per whole notebook. Therefore, you can set it only to the cells you want by finding them with Cells.

SetOptions[#, WholeCellGroupOpener -> True] & /@ 
 Cells[CellStyle -> {"Chapter", "Section"}];
Domen
  • 23,608
  • 1
  • 27
  • 45
  • Thanks for your answer and modifications. It helps a lot! Still, I wonder if I can achieve the goal through "OptionsSetting" in "Format"? I have noticed that some options can be customized. Is "WholeCellGroupOpener" one of them? – Rudy Yan Feb 24 '24 at 09:43
  • I wouldn't know about that. But it doesn't seem like this is possible ... – Domen Feb 24 '24 at 10:59