1
$\begingroup$

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.

$\endgroup$
1

1 Answer 1

4
$\begingroup$

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"}];
$\endgroup$
2
  • $\begingroup$ 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? $\endgroup$
    – Rudy Yan
    Commented Feb 24 at 9:43
  • $\begingroup$ I wouldn't know about that. But it doesn't seem like this is possible ... $\endgroup$
    – Domen
    Commented Feb 24 at 10:59

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.