Message Boards Message Boards

GROUPS:

Use CellGroup[] in current Notebook?

Posted 6 months ago
555 Views
|
2 Replies
|
3 Total Likes
|

(Posted to StackExchange a week ago, with no response.)

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?

2 Replies

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 collegues 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 details? You can as WRI Support.

Posted 6 months ago

Kuba, thank you. (Here is the SE discussion.)

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract