This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Working with Cells

Mathematica notebooks consist of sequences of cells. The hierarchy of cells serves as a structure for organizing the information in a notebook, as well as specifying the overall look of the notebook.
Font, color, spacing, and other properties of the appearance of cells are controlled using stylesheets. The various kinds of cells associated with a notebook's stylesheet are listed in FormatStyle. Mathematica comes with a collection of color and black-and-white stylesheets, which are listed in the FormatStylesheet menu.

In a New Session:

When Mathematica is first started, it displays an empty notebook with a blinking cursor. You can start typing right away.
The insertion point is indicated by the cell insertion bar, a solid gray line with a small black cursor running horizontally across the notebook. The cell insertion bar is the place where new cells will be created, either as you type or programmatically. To set the position of the insertion bar, click in the notebook.

To Create a New Cell:

Move the pointer in the notebook window until it becomes a horizontal I-beam.
Click, and a cell insertion bar will appear; start typing. By default, new cells are Mathematica input cells.

To Create a New Cell to Hold Ordinary Text:

Click in the notebook to get a cell insertion bar. Choose FormatStyleText or use the keyboard shortcut "Alt"+7.
When you start typing, a text cell bracket appears.

To Change the Style of a Cell:

Click the cell bracket. The bracket is highlighted.
Select a style from FormatStyle. The cell will immediately reflect the change.
Alternatively, you can simultaneously press Alt with one of the numbered keys, 0 through  9, to select a style.
Choose WindowShow Toolbar to get a toolbar at the top of the notebook.
Choose WindowShow Ruler to get a ruler at the top of the notebook.

To Close a Group of Cells:

Double-click the outermost cell bracket of the group.
When a group is closed, only the first cell in the group is displayed by default. The group bracket is shown with a triangular flag at the bottom.
To specify which cells remain visible when the cell group is closed, select those cells and double-click to close the group. The closed group bracket is shown with triangular flags at the top and bottom if the visible cells are within a cell group, or with a triangular flag at the top if they are at the end of a cell group.

To Open a Group of Cells:

Double-click a closed group's cell bracket.

To Print a Notebook:

Choose FilePrint. The notebook style will be automatically optimized for printing.

To Change the Overall Look of a Notebook:

Choose FormatStylesheet. Select a stylesheet from the menu. All cells in the notebook will change appearance, based on the definitions in the new stylesheet.
Use FormatEdit Stylesheet to customize stylesheets for Mathematica notebooks.
Changes to a notebook that only involve opening or closing cell groups will not cause the front end to ask you if you want to save such changes when you close the notebook before saving. To save these changes, use FileSave before you close the notebook or quit Mathematica.
To close a notebook, click the Close button in the title bar. You will be prompted to save any unsaved changes.
On Windows, to close notebooks without being prompted to save, hold down the Shift key when clicking the Close box.