How can I print grouped cells with CellPrint ?

The closest thing I have to what I want to do is this


But the cells aren't grouped.


Not pretty, but it works:

  CellGroup[{TextCell["i", "Item", CellTags -> "groupit"], 
    ExpressionCell[Defer[x^2;], "Input", CellTags -> "groupit"]}, 1]];
NotebookFind[EvaluationNotebook[], "groupit", All, CellTags];
SelectionMove[EvaluationNotebook[], After, Cell]
| improve this answer | |
  • $\begingroup$ Thanks, this would be perfect if the grouped cells were closed, as the ExpressionCell typically contains big outputs in what I want to do. $\endgroup$ – faysou Feb 5 '13 at 14:44
  • $\begingroup$ I found it, FrontEndExecute[FrontEndToken["OpenCloseGroup"]]; before SelectionMove $\endgroup$ – faysou Feb 5 '13 at 14:48
  • $\begingroup$ Fyi I have incorporated your answer in my answer here mathematica.stackexchange.com/q/15134/66 $\endgroup$ – faysou Feb 5 '13 at 15:06

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.