How to fold output cells by default?
I'm slow, but eventually I get there. ;-) You need CellEpilog
to make the behavior automatic on evaluation of any cell. Importing the code from my autoFoldOutput
function:
SetOptions[EvaluationNotebook[],
CellEpilog :>
(SelectionMove[EvaluationNotebook[], All, EvaluationCell];
FrontEndTokenExecute["SelectionCloseUnselectedCells"])
]
Simply evaluate that in your Notebook and all output groups will be automatically closed when they are created. You may replace EvaluationNotebook[]
with $FrontEndSession
if you want to affect all Notebooks during the session or with $FrontEnd
to persistently affect all Notebooks.
Not sure if this is what you're looking for, but the Cell
menu has an item that collapses open cells:
Here I highlighted the open input/output cells and then collapsed them to get the following:
If your question is about automatically and immediately collapsing every output cell, then that's a different story. It will most likely involve this answer.