Skip to main content
make it more clear
Source Link
Frank
  • 286
  • 1
  • 6

Even in Mathematica 12.2 we still see forever "Formatting Notebook Contents" if a cell have huge output. One solution is run this at the beginning of a notebook that cannot open due to this error:

HideOutput[] := (SetOptions[#, CellOpen -> False] & /@ 
    Cells[EvaluationNotebook[], CellStyle -> "Output"];)
HideOutput[]

Or only hide a specific cell print or output run one of the following function:

hideprintof[cell_]:=(SetOptions[#,CellOpen->False]&/@ (Select[{#,Options[#,CellLabel]}& /@ Cells[EvaluationNotebook[],CellStyle->"Print"],StringMatchQ["*In["~~ToString[cell]~~"]:="][#[[2,1,2]]]&][[All,1]]);)
hideoutputof[cell_]:=(SetOptions[#,CellOpen->False]&/@ (Select[{#,Options[#,CellLabel]}& /@ Cells[EvaluationNotebook[],CellStyle->"Output"],StringMatchQ["*Out["~~ToString[cell]~~"]="][#[[2,1,2]]]&][[All,1]]);)

Even in Mathematica 12.2 we still see forever "Formatting Notebook Contents" if a cell have huge output. One solution is:

HideOutput[] := (SetOptions[#, CellOpen -> False] & /@ 
    Cells[EvaluationNotebook[], CellStyle -> "Output"];)
HideOutput[]

Or only hide a specific cell:

hideprintof[cell_]:=(SetOptions[#,CellOpen->False]&/@ (Select[{#,Options[#,CellLabel]}& /@ Cells[EvaluationNotebook[],CellStyle->"Print"],StringMatchQ["*In["~~ToString[cell]~~"]:="][#[[2,1,2]]]&][[All,1]]);)
hideoutputof[cell_]:=(SetOptions[#,CellOpen->False]&/@ (Select[{#,Options[#,CellLabel]}& /@ Cells[EvaluationNotebook[],CellStyle->"Output"],StringMatchQ["*Out["~~ToString[cell]~~"]="][#[[2,1,2]]]&][[All,1]]);)

Even in Mathematica 12.2 we still see forever "Formatting Notebook Contents" if a cell have huge output. One solution is run this at the beginning of a notebook that cannot open due to this error:

HideOutput[] := (SetOptions[#, CellOpen -> False] & /@ 
    Cells[EvaluationNotebook[], CellStyle -> "Output"];)
HideOutput[]

Or only hide a specific cell print or output run one of the following function:

hideprintof[cell_]:=(SetOptions[#,CellOpen->False]&/@ (Select[{#,Options[#,CellLabel]}& /@ Cells[EvaluationNotebook[],CellStyle->"Print"],StringMatchQ["*In["~~ToString[cell]~~"]:="][#[[2,1,2]]]&][[All,1]]);)
hideoutputof[cell_]:=(SetOptions[#,CellOpen->False]&/@ (Select[{#,Options[#,CellLabel]}& /@ Cells[EvaluationNotebook[],CellStyle->"Output"],StringMatchQ["*Out["~~ToString[cell]~~"]="][#[[2,1,2]]]&][[All,1]]);)
Source Link
Frank
  • 286
  • 1
  • 6

Even in Mathematica 12.2 we still see forever "Formatting Notebook Contents" if a cell have huge output. One solution is:

HideOutput[] := (SetOptions[#, CellOpen -> False] & /@ 
    Cells[EvaluationNotebook[], CellStyle -> "Output"];)
HideOutput[]

Or only hide a specific cell:

hideprintof[cell_]:=(SetOptions[#,CellOpen->False]&/@ (Select[{#,Options[#,CellLabel]}& /@ Cells[EvaluationNotebook[],CellStyle->"Print"],StringMatchQ["*In["~~ToString[cell]~~"]:="][#[[2,1,2]]]&][[All,1]]);)
hideoutputof[cell_]:=(SetOptions[#,CellOpen->False]&/@ (Select[{#,Options[#,CellLabel]}& /@ Cells[EvaluationNotebook[],CellStyle->"Output"],StringMatchQ["*Out["~~ToString[cell]~~"]="][#[[2,1,2]]]&][[All,1]]);)