WOLFRAM LANGUAGE TUTORIAL

Options for Cells

The Wolfram Language provides a large number of options for cells. All of these options can be accessed through the Option Inspector menu item in the front end. They can be set either directly at the level of individual cells or at a higher level, to be inherited by individual cells.

option
typical default value
CellDingbatNonea dingbat to use to emphasize the cell
CellFrameFalsewhether to draw a frame around the cell
BackgroundNonethe background color for the cell
ShowCellBracketTruewhether to display the cell bracket
Magnification1.the magnification at which to display the cell
CellOpenTruewhether to display the contents of the cell

Some basic cell display options.

This creates a cell in "Section" style with default settings for all options.
This creates a cell with dingbat and background options modified.
option
typical default value
CellMargins{{7,0},{4,4}}outer margins in printer's points to leave around the contents of the cell
CellFrameMargins8margins to leave inside the cell frame
CellElementSpacingslist of rulesdetails of the layout of cell elements
CellBaselineBaselinehow to align the baseline of an inline cell with text around it

Options for cell positioning.

The option CellMargins allows you to specify both horizontal and vertical margins to put around a cell. You can set the horizontal margins interactively by using the margin stops in the ruler displayed when you choose the Show Ruler menu item in the front end.

Whenever an option can refer to all four edges of a cell, the Wolfram Language follows the convention that the setting for the option takes the form . By giving nonzero values for the top and bottom elements, CellMargins can specify gaps to leave above and below a particular cell. The values are always taken to be in printer's points.

This leaves 50 points of space on the left of the cell, and 20 points above and below.

Almost every aspect of Wolfram System notebooks can be controlled by some option or another. More detailed aspects are typically handled by "aggregate options" such as . The settings for these options are lists of Wolfram Language rules, which effectively give values for a sequence of suboptions. The names of these suboptions are usually strings rather than symbols.

This shows the settings for all the suboptions associated with .
In[4]:=
Click for copyable input
Out[4]=

The Wolfram System allows you to embed cells inside pieces of text. The option CellBaseline determines how such "inline cells" will be aligned vertically with respect to the text around them. In direct analogy with the option BaselinePosition for a Grid, the option CellBaseline specifies what aspect of the cell should be considered its baseline.

Here is a cell containing an inline formula. The baseline of the formula is aligned with the baseline of the text around it.

7.gif

Here is a cell in which the bottom of the formula is aligned with the baseline of the text around it.

8.gif

This alignment is specified using the CellBaseline->Bottom setting.

9.gif

option
typical default value
CellLabel""a label for a cell
ShowCellLabelTruewhether to show the label for a cell
CellLabelAutoDeleteTruewhether to delete the label if the cell is modified
CellTags{}tags for a cell
ShowCellTagsFalsewhether to show tags for a cell
ConversionRules{}rules for external conversions

Options for ancillary data associated with cells.

In addition to the actual contents of a cell, it is often useful to associate various kinds of ancillary data with cells.

In a standard Wolfram System session, cells containing successive lines of kernel input and output are given labels of the form In[n]:= and Out[n]=. The option ShowCellLabel determines whether such labels should be displayed. CellLabelAutoDelete determines whether the label on a cell should be removed if the contents of the cell are modified. Doing this ensures that In[n]:= and Out[n]= labels are only associated with unmodified pieces of kernel input and output.

Cell tags are typically used to associate keywords or other attributes with cells, which can be searched for using functions like NotebookFind. Destinations for hyperlinks in Wolfram System notebooks are usually implemented using cell tags.

The option ConversionRules allows you to give a list containing entries such as "TeX"->data which specify how the contents of a cell should be converted to external formats. This is particularly relevant if you want to keep a copy of the original form of a cell that has been converted in Wolfram System notebook format from some external format.

option
typical default value
DeletableTruewhether to allow a cell to be deleted interactively with the front end
CopyableTruewhether to allow a cell to be copied
SelectableTruewhether to allow the contents of a cell to be selected
EditableTruewhether to allow the contents of a cell to be edited
DeployedFalsewhether the user interface in the cell is active

Options for controlling interactive operations on cells.

The options Deletable, Copyable, Selectable, and Editable allow you to control what interactive operations should be allowed on cells. By setting these options to False at the notebook level, you can protect all the cells in a notebook.

Deployed allows you to treat the contents of a cell as if they were a user interface. In a user interface, labels are typically not selectable and controls such as buttons can be used, but not modified. Deployed can also be set on specific elements inside a cell so that, for example, the output of Manipulate is always deployed even if the cell it is in has the Deployed option set to False.

option
typical default value
Evaluator"Local"the name of the kernel to use for evaluations
EvaluatableFalsewhether to allow the contents of a cell to be evaluated
CellAutoOverwriteFalsewhether to overwrite previous output when new output is generated
GeneratedCellFalsewhether this cell was generated from the kernel
InitializationCellFalsewhether this cell should automatically be evaluated when the notebook is opened

Options for evaluation.

The Wolfram Language makes it possible to specify a different evaluator for each cell in a notebook. But most often, the Evaluator option is set only at the notebook or global level, typically using the Kernel Configuration Options menu item in the front end.

The option CellAutoOverwrite is typically set to True for styles that represent Wolfram Language output. Doing this means that when you reevaluate a particular piece of input, the Wolfram Language will automatically delete the output that was previously generated from that input, and will overwrite it with new output.

The option GeneratedCell is set whenever a cell is generated by an external request to the front end rather than by an interactive operation within the front end. Thus, for example, any cell obtained as an output or side effect from a kernel evaluation will have GeneratedCell->True. Cells generated by low-level functions designed to manipulate notebooks directly, such as NotebookWrite and NotebookApply, do not have the GeneratedCell option set.

option
typical default value
PageBreakAboveAutomaticwhether to put a page break just above a particular cell
PageBreakWithinAutomaticwhether to allow a page break within a particular cell
PageBreakBelowAutomaticwhether to put a page break just below a particular cell
GroupPageBreakWithinAutomaticwhether to allow a page break within a particular group of cells

Options for controlling page breaks when cells are printed.

When you display a notebook on the screen, you can scroll continuously through it. But if you print the notebook out, you have to decide where page breaks will occur. A setting of Automatic for a page break option tells the Wolfram System to make a page break if necessary; True specifies that a page break should always be made, while False specifies that it should never be.

Page breaks set using the PageBreakAbove and PageBreakBelow options also determine the breaks between slides in a slide show. When creating a slide show, you will typically use a cell with a special named style to determine where each slide begins. This named style will have one of the page-breaking options set on it.