CellPrint

CellPrint[expr]
inserts expr as a complete cell in the current notebook just below the cell being evaluated.

CellPrint[{expr1,expr2,}]
inserts a sequence of cells.

DetailsDetails

  • If expr has head TextCell, ExpressionCell, or CellGroup, it is inserted unchanged into the notebook. »
  • If expr is a string or Text object, a text cell is created to contain it. »
  • If expr is any other type of expression, an expression cell is created to contain it. »
  • With a textbased front end, CellPrint[cell] does the same as applying Print to the contents of cell.
  • Cells generated by CellPrint by default have GeneratedCell->True, so that they are overwritten if they are regenerated.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Create a text cell from a TextCell object:

In[1]:=
Click for copyable input

Create a sequence of text cells:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input

Create a text cell from a string:

In[1]:=
Click for copyable input
a
Introduced in 1996
(3.0)
| Updated in 2007
(6.0)