By default output cells are grouped with the input cell from which they are generated (note the nested cell brackets on the right):
Sometimes it is desirable to group manually input cell with previous
"Text" cell containing some comments/description. We can do it manually by selecting both cells and then applying the "Group Cells" item from the right-click menu:
Now both cells are placed in one group:
And this is what happens when we evaluate the grouped input cell:
Now output cells aren't automatically grouped with the input cell anymore!
First question: Is it possible to keep automatic grouping for generated cells if the input cell was manually grouped with some previous cell?
But it is not the end of the story. Being in despair due to this behavior, I manually delete the output cells as well as the text cell, and then try to evaluate my input cell again. Here is what I get:
Surprisingly, output cells aren't grouped with the input cell again! Obviously, the FrontEnd somehow has "marked" this input cell to behave differently. Let us check its internal expression (I selected the cell and pressed Clrl+Shift+E):
Second question: What makes this cell "special" and how to make it an "ordinary" cell again?
Now I copy this cell and try to evaluate it in another place of the Notebook:
The copy obviously is also "special": the automatic grouping doesn't work for it as well! So with the cell some "flag" marking it as "special" was copied. What can it be and how can I remove such a "flag"?
If I copy not the cell, but only the code from it, and then paste as a new cell, normal grouping behavior is restored:
To summarize, my questions are:
Is it possible to keep automatic grouping for generated cells if the input cell was manually grouped with some previous cell?
How FrontEnd "marks" the cell as a "special" and how is it possible to remove such a "mark"?