Let us say that I want to make all the cells within a section not evaluable. In principle, I would simply highlight the relevant section, then go to Cell -> Cell properties and untick the Evaluable.
However, the problem is that if for some reason, I wish to make the section evaluable again, I would go back and tick the Evaluable box again. This, however, causes the section title and all the Texts within the section to also be evaluated, which of course is not what I want. When I toggle back the Evaluable, I would like it to do so only for the Input Cells of course. Is there to achieve this?
Asked
Active
Viewed 190 times
3
Patrick.B
- 1,399
- 5
- 11
1 Answers
1
The key is to re-enable it with CurrentValue[_CellObject, Evaluatable] = Inherited. You can create a custom palette:
CreatePalette @ Column[
Button[
StringForm["Evaluatable -> ``", #],
CurrentValue[SelectedCells@InputNotebook[], Evaluatable] = #
] & /@ {False, Inherited}
]
Or you can use notebook actions analogously to https://mathematica.stackexchange.com/a/184568/5478
Kuba
- 136,707
- 13
- 279
- 740
-
1CurrentValue can be used to set all cells at once, so:
CurrentValue[SelectedCells @ InputNotebook[], Evaluatable] = Falseis simpler. – Carl Woll Mar 17 '19 at 23:05 -
Edit -> Un/Comment sectionor just put comments over something you don't want? – Brad Mar 12 '19 at 20:59