2
$\begingroup$

I have used the Option Inspector to set CellGrouping to Manual for the current, selected Notebook. Nonetheless, the following does not group these two cells together:

CellPrint[CellGroup[{TextCell["hello"], TextCell["goodbye"]}]]

Also, adding the second argument to CellGroup[] to specify which cell should be open, does not work.

Please note that both of these work if I create the cells in a new Notebook, created with CellGrouping -> Manual.

I saw the same behavior with Cell[CellGroupData[...]].

What am I missing?

$\endgroup$
2
$\begingroup$

Unfortunately there are many issues related to cell groups structure: SE / Cell @ CellGroupData in Cells family

And my rules of thumb, unfortunately, are:

  • only use CellGroup+TextCell+ExpressionCell and friends, which are a higher level equivalents of CellGroupData and Cell, for small snippets rather than serious work. Why? I don't know, maybe I just can't handle them but writing your code in a low level form works:

    NotebookWrite[EvaluationNotebook[],  
      Cell@CellGroupData[{Cell["hello"], Cell["goodbye"]}]
    ]
    
  • don't expect much from Manual CellGrouping with respect to other related options. Same reason.

You want more details? You can as WRI Support.

$\endgroup$
  • $\begingroup$ Kuba, thank you. Here is the parallel question at Wolfram. $\endgroup$ – Aharon Naiman Mar 16 '18 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.