CreateDocument

CreateDocument[]

creates an empty document notebook and opens it in the front end.

CreateDocument[expr]

creates and opens a document notebook containing the expression expr.

CreateDocument[{expr1,expr2,}]

creates and opens a document notebook consisting of a sequence of cells containing the expri.

CreateDocument[expr,obj]

replaces the notebook represented by the notebook object obj with the one obtained from expr.

Details and Options

  • Possible forms for expr and expri include:
  • DocumentNotebook[]a complete notebook
    TextCell[]a text cell
    ExpressionCell[]an expression cell
    CellGroup[]a cell group, potentially nested
    "string"a string, inside a text cell
    ean expression e, in an expression cell
  • CreateDocument can take any notebook option, together with the following additional options:
  • WindowSelectedTruewhether the new window should immediately be selected
    NotebookFileNameNonethe file name for the document created
  • CreateDocument will by default create a notebook with name "Untitled-n".
  • CreateDocument returns a NotebookObject corresponding to the notebook it creates.
  • CreateDocument[expr,obj] overwrites whatever data was contained in the notebook represented by the notebook object obj.

Examples

open allclose all

Basic Examples  (2)

Specify styles for cells:

Scope  (4)

Create a notebook with a two-dimensional typeset expression:

Create a document containing an unevaluated expression:

Create a notebook with a graphic:

Create a notebook with a grid:

Options  (4)

CellDingbat  (1)

Set a cell dingbat:

CellGrouping  (1)

Make a document with manually grouped cells:

TextAlignment  (1)

Align contents on the right:

Visible  (1)

Create a notebook that is not visible:

Make the notebook appear:

Properties & Relations  (1)

CreateDocument combines the functions of DocumentNotebook and CreateWindow:

Introduced in 2007
 (6.0)