Temporarily disabling all input cells in a section of a notebook
Asked Answered
C

1

6

Is there a way to disable all input cells in a cell group / section, in a way that is easily reversed later?

My aim is to keep a section of a notebook intact, but prevent it from being evaluated when "Evaluate Notebook" is selected in the front end.

There's Cell -> Cell properties -> Evaluatable, but using this would require me to select every input cell manually and change/restore this property. This is too much work. I have text/subsection/output cells interlaced.

Is there a better way using the UI? If not, is there a simple programmatic way?

EDIT: I found Alt-click, which selects all input cells in the notebook. Can this be restricted to a section / cell-group only?

Cryology answered 2/11, 2011 at 17:40 Comment(2)
This is an interesting question. I would take it one step further, and ask: is there a way to create an Evaluatable toggle for each section?Adopted
@Adopted For the toggle UI part this may be useful: https://mcmap.net/q/1371941/-getting-celldingbat-to-remember-its-state-between-mathematica-sessions/695132Cryology
G
7
  • Option-click to select all Input cells.
  • Command-click twice (once to select, once to deselect) each cell group you don't want to include.

Also, you could just set Evaluatable->False on the entire cell group you want to disable. The Text, Subsection, & Output cells in that group won't cause any problems.

Glasser answered 2/11, 2011 at 18:26 Comment(2)
If I set Evaluatable on a Text cell, it will indeed become evaluatable (which is undesirable), the other method works though. I do wish there were a method which requires operation on the relevant cells only, and not everything else (i.e. here it's necessary to deselect everything else). Do you know where these mouse shortcuts are documented? I couldn't find them.Cryology
Shift-click and command-click behave the same in Mathematica as in nearly every other piece of desktop software in existence. I wouldn't be surprised if they're not documented anywhere. Option-click does have a unique behavior in Mathematica. I don't know whether or not it's documented.Glasser

© 2022 - 2024 — McMap. All rights reserved.