({{, (RefLink[DocumentNotebook, paclet:ref/DocumentNotebook])[{(Subscript[cell, 1]),(Subscript[cell, 2]),…}]
represents a complete document notebook in the Wolfram System front end. }})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[CreateWindow, paclet:ref/CreateWindow]) takes a (RefLink[DocumentNotebook, paclet:ref/DocumentNotebook]) expression and displays it in a separate window.

If generated as output within a notebook, (RefLink[DocumentNotebook, paclet:ref/DocumentNotebook]) displays as an in-cell representation of a notebook.

(RefLink[DocumentNotebook, paclet:ref/DocumentNotebook]) can take any notebook option.

OpenersPrimaryExamplesSection(Spacer1)Examples  (14)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

DocumentNotebook[{x+y,1/x+1/y}]

Specify styles for cells:

DocumentNotebook[{TextCell["The head","Section"],TextCell["first cell"]}]

OpenersExampleSection1(Spacer1)Scope  (3)

A notebook with a two-dimensional typeset expression:

DocumentNotebook[{TextCell["S1","Section"],ExpressionCell[x^2,"Input"]}]

A notebook with a graphic:

DocumentNotebook[{Plot[x^2,{x,-1,1}]}]

A notebook with a grid:

DocumentNotebook[{Grid[Array[a,{2,3}]]}]

OpenersExampleSection2(Spacer1)Options  (5)

OpenersExampleSubsection0(Spacer1)Background  (1)

Set a background color:

CreateWindow[DocumentNotebook[{a,b},Background->RGBColor[1,.9,.7]]];

OpenersExampleSubsection1(Spacer1)CellDingbat  (1)

Set a cell dingbat:

CreateWindow[DocumentNotebook[{a,b},CellDingbat->"\[MathematicaIcon]"]];

OpenersExampleSubsection2(Spacer1)CellGrouping  (1)

Make a document with manually grouped cells:

CreateWindow[DocumentNotebook[{CellGroup[{a,b}],c},CellGrouping->Manual]];

OpenersExampleSubsection3(Spacer1)TextAlignment  (1)

Align contents on the right:

CreateWindow[DocumentNotebook[{a,b},TextAlignment->Right]];

OpenersExampleSubsection4(Spacer1)Visible  (1)

Create a notebook that is not visible:

nb=CreateWindow[DocumentNotebook[{a,b},Visible->False]];

Make the notebook appear:

SetOptions[nb,Visible->True]

OpenersExampleSection3(Spacer1)Applications  (2)

Define a template for a standard document:

mammalPage[common_,picture_,order_,family_,species_]:=DocumentNotebook[Style[Grid[{{Style[common,FontSize->18],SpanFromLeft},{picture,Column[Row[{#1,": ", Style[#2,FontWeight->Bold]}]&@@@{{"Order",order},{"Family",family},{"Species",species}}]}},Frame->True],FontFamily->"Arial",ShowStringCharacters->False]]

CreateWindow[mammalPage["Ocelot",Import["ExampleData/ocelot.jpg"],"Carnivora","Felidae","Leopardus pardalis"]];

Turn a list structure into document structure:

outline[l_List]:=l//.{s_String,r___}:>f[s,r]/.s_String:>TextCell[s]//.f[c__]:>CellGroup[{c}]

outline[{"Chap. 1",{"Sec. 1","a"},{"Sec. 2","b","c"}}]//InputForm

CreateWindow[DocumentNotebook[%,CellGrouping->Manual]];

OpenersExampleSection4(Spacer1)Properties & Relations  (2)

Use (RefLink[CreateWindow, paclet:ref/CreateWindow]) to get a (RefLink[NotebookObject, paclet:ref/NotebookObject]):

nb=CreateWindow[DocumentNotebook[{a,b,c}]];

Use the (RefLink[NotebookObject, paclet:ref/NotebookObject]) in commands that act on the notebook:

SelectionMove[nb,Next,Cell]

NotebookRead[nb]

NotebookDelete[nb]

(RefLink[PaletteNotebook, paclet:ref/PaletteNotebook]) and (RefLink[DialogNotebook, paclet:ref/DialogNotebook]) objects are mainly used as user interface tools:

PaletteNotebook[{"Square root",Button[(Sqrt[π]),p=N[(Sqrt[π])]]}]

DialogNotebook[{TextCell[Row[{"Your name:",InputField[]}]]}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[CreateDocument, paclet:ref/CreateDocument])  ▪  (RefLink[CreateNotebook, paclet:ref/CreateNotebook])  ▪  (RefLink[PaletteNotebook, paclet:ref/PaletteNotebook])  ▪  (RefLink[DialogNotebook, paclet:ref/DialogNotebook])  ▪  (RefLink[CreateWindow, paclet:ref/CreateWindow])  ▪  (RefLink[Export, paclet:ref/Export])  ▪  (RefLink[Notebook, paclet:ref/Notebook])  ▪  (RefLink[NotebookImport, paclet:ref/NotebookImport])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Notebook Document Generation, paclet:guide/DocumentGeneration])}, {▪(RefLinkPlain[Text Generation, paclet:guide/TextConstruction])}})}})