How can I print grouped cells with CellPrint ?
The closest thing I have to what I want to do is this
CellPrint[CellGroup[{TextCell["i","Item"],ExpressionCell[Defer[x^2;],"Input"]},1]]
But the cells aren't grouped.
Not pretty, but it works:
CellPrint[
CellGroup[{TextCell["i", "Item", CellTags -> "groupit"],
ExpressionCell[Defer[x^2;], "Input", CellTags -> "groupit"]}, 1]];
NotebookFind[EvaluationNotebook[], "groupit", All, CellTags];
FrontEndExecute[FrontEndToken["CellGroup"]];
SelectionMove[EvaluationNotebook[], After, Cell]