I've gotten in the habit of changing the background color of modified chunks of code using the Format - Background Color
menu on the selected code. E.g.
Now I'd like to clear these out of a large notebook to start anew, but selecting all cells and setting the background color back to None
using the same menu item doesn't work. Is there another way to remove all these chunks of colored code from a notebook?
Running Cell - Show Expression
reveals the internal structure is:
Cell[BoxData[
RowBox[{
RowBox[{"test", "=",
StyleBox[
RowBox[{"1", "+", "2", "+", "3"}],
Background->RGBColor[1, 0.5, 0]]}], ";"}]], "Input",
CellChangeTimes->{{3.88184852903022*^9, 3.881848539448594*^9}},
CellLabel->"In[19]:="]
but I don't know how to modify the internal structure of all cells programmatically.
NotebookGet[...] /. (Background -> ...) :> Sequence[] // NoteboomPut
. This should be a lot more robust & performant than doing the modifications via the front-end, and it has the benefit that you get a copy of the original notebook, rather than having to risk destroying something $\endgroup$Format - Clear Formatting
which works! $\endgroup$Format - Clear Formatting
is too broad for my purposes, because it removes all formatting (including theTI
style that I use in usage messages). So I will have to stick with something like @LukasLang suggested. $\endgroup$