Manipulating Notebooks

Cells as Wolfram Language Expressions
Like other objects in the Wolfram Language, the cells in a notebook, and in fact the whole notebook itself, are all ultimately represented as Wolfram Language expressions. With the standard notebook front end, you can use the command Show Expression to see the text of the Wolfram Language expression that corresponds to any particular cell.
Show Expression menu item
toggle between displayed form and underlying Wolfram Language expression
Ctrl+* or Ctrl+8 (between existing cells)
put up a dialog box to allow input of a cell in Wolfram Language expression form
Handling Cell expressions in the notebook front end.
Here is a cell displayed in its usual way in the front end.


Here is the underlying Wolfram Language expression that corresponds to the cell.


a cell with a specific style
a cell with additional options specified
a cell with several styles
Wolfram Language expressions corresponding to cells in notebooks.
Within a given notebook, there is always a collection of styles that can be used to determine the appearance and behavior of cells. Typically the styles are named so as to reflect what role cells which have them will play in the notebook.
the title of the notebook
a section heading
a subsection heading
ordinary text
Wolfram Language input
Wolfram Language output
Some typical cell styles defined in notebooks.
Here are several cells in different styles.


Here are the expressions that correspond to these cells.


A particular style such as "Section" or "Text" defines various settings for the options associated with a cell. You can override these settings by explicitly setting options within a specific cell.
Here is the expression for a cell in which options are set to use a gray background and to put a frame around the cell.


This is how the cell looks in a notebook.


default value
whether to draw a frame around the cell
what color to draw the background for the cell
whether to allow the contents of the cell to be edited
how to align text in the cell
the point size of the font for text
tags to be associated with the cell
A few of the large number of possible options for cells.
The standard notebook front end for the Wolfram System provides several ways to change the options of a cell. In simple cases, such as changing the size or color of text, there will often be a specific menu item for the purpose. But in general you can use the Option Inspector that is built into the front end. This is typically accessed using the Option Inspector menu item in the Format menu.
Change settings for specific options with menus.
Look at and modify all options with the Option Inspector.
Edit the textual form of the expression corresponding to the cell.
Change the settings for all cells with a particular style.
Ways to manipulate cells in the front end.
Sometimes you will want just to change the options associated with a specific cell. But often you may want to change the options associated with all cells in your notebook that have a particular style. You can do this by using the Edit Stylesheet command in the front end to create a custom stylesheet associated with your notebook. Then use the controls in the stylesheet to create a cell corresponding to the style you want to change and modify the options for that cell.
insert a cell into your currently selected notebook
insert a sequence of cells into your currently selected notebook
Inserting cells into a notebook.
This inserts a section cell into the current notebook:


This inserts a text cell with a frame around it:


CellPrint allows you to take a raw Cell expression and insert it into your current notebook. The cell created by CellPrint is grouped with the input and will be overwritten if the input is reevaluated.
Notebooks as Wolfram Language Expressions
a notebook containing a sequence of cells
a notebook with options specified
Expressions corresponding to notebooks.
Here is a simple Wolfram System notebook.


Here is the expression that corresponds to this notebook.
Cell["Section heading", "Section"],
Cell["Some text.", "Text"],
Cell["More text.", "Text"]}]
Just like individual cells, notebooks in the Wolfram System can also have options. You can look at and modify these options using the Option Inspector in the standard notebook front end.
default value
the size in pixels of the window used to display the notebook
whether the window should float on top of others
what toolbars to include at the top of the window
whether to show where page breaks would occur if the notebook were printed
how to group cells in the notebook
what kernel should be used to do evaluations in the notebook
whether a notebook can be saved
A few of the large number of possible options for notebooks.
A notebook with the option setting Saveable->False can always be saved using the Save As menu item, but does not respond to Save and does not prompt for saving when it is closed.
In addition to notebook options, you can also set any cell option at the notebook level. Doing this tells the Wolfram System to use that option setting as the default for all the cells in the notebook. You can override the default by explicitly setting the options within a particular cell or by using a named style which explicitly overrides the option.
Here is the expression corresponding to a notebook with a ruler displayed in the toolbar at the top of the window.
Cell["Section heading", "Section"],
Cell["Some text.", "Text"]},
This is what the notebook looks like in the front end.


This sets the default background color for all cells in the notebook.
Cell["Section heading", "Section"],
Cell["Some text.", "Text"]},
Now each cell has a gray background.


If you go outside of the Wolfram System and look at the raw text of the file that corresponds to a Wolfram System notebook, you will find that what is in the file is just the textual form of the expression that represents the notebook. One way to create a Wolfram System notebook is therefore to construct an appropriate expression and put it in a file.
In notebook files that are written out by the Wolfram System, some additional information is typically included to make it faster for the Wolfram System to read the file in again. The information is enclosed in Wolfram Language comments indicated by (**) so that it does not affect the actual expression stored in the file.
open a notebook file in the front end
create a notebook corresponding to expr in the front end
get the expression corresponding to an open notebook in the front end
Setting up notebooks in the front end from the kernel.
This writes a notebook expression out to the file sample.nb:
This reads the notebook expression back from the file:
This opens sample.nb as a notebook in the front end:


Once you have set up a notebook in the front end using NotebookOpen, you can then manipulate the notebook interactively just as you would any other notebook. But in order to use NotebookOpen, you have to explicitly have a notebook expression in a file. With NotebookPut, however, you can take a notebook expression that you have created in the kernel, and immediately display it as a notebook in the front end.
Here is a notebook expression in the kernel:
This uses the expression to set up a notebook in the front end:


You can use NotebookGet to get the notebook corresponding to a particular NotebookObject back into the kernel:
Manipulating Notebooks from the Kernel
If you want to do simple operations on Wolfram System notebooks, then you will usually find it convenient just to use the interactive capabilities of the standard Wolfram System front end. But if you want to do more complicated and systematic operations, then you will often find it better to use the kernel.
a list of all your open notebooks
a list of all open notebooks with the specified name
the notebook into which typed input will go
the notebook in which this function is being evaluated
the notebook containing the button (if any) which initiated this evaluation
Functions that give the notebook objects corresponding to particular notebooks.
Within the Wolfram Language kernel, notebooks that you have open in the front end are referred to by notebook objects of the form NotebookObject[fe,id]. The first argument of NotebookObject specifies the FrontEndObject for the front end in which the notebook resides, while the second argument gives a unique serial number for the notebook.
Here is a notebook named Example.nb.


This finds the corresponding notebook object in the front end:
This gets the expression corresponding to the notebook into the kernel:
This replaces every occurrence of the string "Section" by "Text":
This creates a new modified notebook in the front end:


get the notebook expression corresponding to the notebook object obj
replaces the notebook represented by the notebook object obj with one corresponding to expr
creates a notebook corresponding to expr and makes it the currently selected notebook in the front end
Exchanging whole notebook expressions between the kernel and front end.
If you want to do extensive manipulations on a particular notebook you will usually find it convenient to use NotebookGet to get the whole notebook into the kernel as a single expression. But if instead you want to do a sequence of small operations on a notebook, then it is often better to leave the notebook in the front end, and then to send specific commands from the kernel to the front end to tell it what operations to do.
The Wolfram Language is set up so that anything you can do interactively to a notebook in the front end you can also do by sending appropriate commands to the front end from the kernel.
give a list of all options set for the notebook corresponding to notebook object obj
give the option setting
give the option setting with absolute option values even when the actual setting is Automatic
give and set the value of option
set the value of an option
Finding and setting options for notebooks.
This gives the setting of the WindowSize option for your currently selected notebook:
This changes the size of the currently selected notebook on the screen:


Alternatively, use CurrentValue to directly get the value of the WindowSize option:
This changes the option using CurrentValue with a simple assignment:


Within any open notebook, the front end always maintains a current selection. The selection can consist for example of a region of text within a cell or of a complete cell. Usually the selection is indicated on the screen by some form of highlighting. The selection can also be between two characters of text, or between two cells, in which case it is usually indicated on the screen by a vertical or horizontal insertion bar.
You can modify the current selection in an open notebook by issuing commands from the kernel.
move the current selection to make it be the next unit of the specified type
move to the previous unit
move to just after the end of the present unit of the specified type
move to just before the beginning of the present unit
extend the current selection to cover the whole unit of the specified type
Moving the current selection in a notebook.
individual character
word or other token
complete subexpression
line of text
paragraph of text
the contents of the graphic
the contents of the cell
complete cell
cell group
cell associated with the current evaluation
cell associated with any button that initiated the evaluation
cell generated by the current evaluation
complete notebook
Units used in specifying selections.
Here is a simple notebook.


This sets nb to be the notebook object corresponding to the current input notebook:
This moves the current selection within the notebook to be the next word:


This extends the selection to the complete first cell:


This puts the selection at the end of the whole notebook:


move the current selection to the next occurrence of the specified data in a notebook
move to the previous occurrence
make the current selection cover all occurrences
search in the specified elements of each cell, going in direction dir
do not distinguish uppercase and lowercase letters in text
Searching the contents of a notebook.
This moves the current selection to the position of the previous occurrence of the word cell:


The letter does not appear in the current notebook, so $Failed is returned, and the selection is not moved:


contents of each cell
the name of the style for each cell
the label for each cell
tags associated with each cell
several kinds of elements
Possible elements of cells to be searched by NotebookFind.
In setting up large notebooks, it is often convenient to insert tags which are not usually displayed, but which mark particular cells in such a way that they can be found using NotebookFind. You can set up tags for cells either interactively in the front end, or by explicitly setting the CellTags option for a cell.
locate and select cells with the specified tag in the current notebook
open another notebook if necessary
Globally locating cells in notebooks.
NotebookLocate is typically the underlying function that the Wolfram Language calls when you follow a hyperlink in a notebook. The Insert Hyperlink menu item sets up the appropriate NotebookLocate as part of the script for a particular hyperlink button.
write data into a notebook at the current selection
write data into a notebook, inserting the current selection in place of the first that appears in data
delete whatever is currently selected in a notebook
get the expression that corresponds to the current selection in a notebook
Writing and reading in notebooks.
NotebookWrite[obj,data] is similar to a Paste operation in the front end: it replaces the current selection in your notebook by data. If the current selection is a cell NotebookWrite[obj,data] will replace the cell with data. If the current selection lies between two cells, however, then NotebookWrite[obj,data] will create an appropriate new cell or cells.
Here is a notebook with a word of text selected.


This replaces the selected word by new text:


This moves the current selection to just after the first cell in the notebook:


This now inserts a text cell after the first cell in the notebook:


This makes the current selection be the next cell in the notebook:


This reads the current selection, returning it as an expression in the kernel:


NotebookWrite[obj,data] just discards the current selection and replaces it with data. But particularly if you are setting up palettes, it is often convenient first to modify data by inserting the current selection somewhere inside it. You can do this using selection placeholders and NotebookApply. The first time the character "", entered as [SelectionPlaceholder] or EscsplEsc, appears anywhere in data, NotebookApply will replace this character by the current selection.
Here is a simple notebook with the current selection being the contents of a cell:


This replaces the current selection by a string that contains a copy of its previous form:


evaluate the current selection in place
create a new cell containing just the current selection
evaluate the current selection and create a new cell for the result
animate graphics in the current selection
animate graphics for seconds
Operations on the current selection.
This makes the current selection be the whole contents of the cell:


This evaluates the current selection in place:


SelectionEvaluate allows you to take material from a notebook and send it through the kernel for evaluation. On its own, however, SelectionEvaluate always overwrites the material you took. But by using functions like SelectionCreateCell you can maintain a record of the sequence of forms that are generatedjust like in a standard Wolfram System session.
This makes the current selection be the whole cell:


This creates a new cell and copies the current selection into it:


This wraps Factor around the contents of the current cell:


This evaluates the contents of the current cell and creates a new cell to give the result:


Functions like NotebookWrite and SelectionEvaluate by default leave the current selection just after whatever material they insert into your notebook. You can then always move the selection by explicitly using SelectionMove. But functions like NotebookWrite and SelectionEvaluate can also take an additional argument which specifies where the current selection should be left after they do their work.
write data into a notebook, leaving the current selection as specified by sel
write data replacing by the previous current selection, then leaving the current selection as specified by sel
evaluate the current selection, making the new current selection be as specified by sel
create a new cell containing just the current selection, and make the new current selection be as specified by sel
evaluate the current selection, make a new cell for the result, and make the new current selection be as specified by sel
Performing operations and specifying what the new current selection should be.
immediately after whatever material is inserted (default)
immediately before whatever material is inserted
the inserted material itself
the first in the inserted material
leave the current selection unchanged
Specifications for the new current selection.
Here is a blank notebook:


This writes 10! into the notebook, making the current selection be what was written:


This evaluates the current selection, creating a new cell for the result, and making the current selection be the whole of the result:


This wraps FactorInteger around the current selection:


This evaluates the current selection, leaving the selection just before the result:


This now inserts additional text at the position of the current selection:


find the value of an option for a complete notebook
find the value for the current selection
set the value of an option for a complete notebook
set the value for the current selection
Finding and setting options for whole notebooks and for the current selection.
Make the current selection be a complete cell:


Put a frame around the cell that is the current selection:


create a new notebook
create a notebook with specified options
open an existing notebook
open a notebook with specified notebook options
make the specified notebook the selected one
send a notebook to your printer
send a PostScript version of a notebook to a file
send a PostScript version of a notebook to an external command
save the current version of a notebook in a file
save the notebook in a file with the specified name
close a notebook
Operations on whole notebooks.
If you call CreateWindow[] a new empty notebook will appear on your screen.
By executing commands like SetSelectedNotebook and NotebookOpen, you tell the Wolfram System front end to change the windows you see. Sometimes you may want to manipulate a notebook without ever having it displayed on the screen. You can do this by using the option setting Visible->False in NotebookOpen or CreateWindow.
Manipulating the Front End from the Kernel
the front end currently in use
the setting for a global option in the front end
the absolute setting for an option
reset an option in the front end
CurrentValue[$FrontEnd, option]
return option value, and also allow setting of option when used as the left-hand side of an assignment
Manipulating global options in the front end.
Just like cells and notebooks, the complete Wolfram System front end has various options, which you can look at and manipulate from the kernel.
This gives the object corresponding to the front end currently in use:
This gives the current directory used by the front end for notebook files:
default value
(system dependent)
the default directory for opening and saving notebook files
(system dependent)
the path to search when trying to open notebooks
default language for text
(list of settings)
how to handle various help and warning messages
A few global options for the Wolfram System front end.
By using NotebookWrite you can effectively input to the front end any ordinary text that you can enter on the keyboard. FrontEndTokenExecute allows you to send from the kernel any command that the front end can execute. These commands include both menu items and control sequences.
execute a named command in the front end
Executing a named command in the front end.
indent all selected lines by one tab
display statistics about the current notebook
toggle a cell group between open and closed
split a cell in two at the current insertion point
create a new cell which is a duplicate of the nearest input cell above
bring up the Find dialog
bring up the Color Selector dialog
align selected graphics
complete the command name that is the current selection
A few named commands that can be given to the front end. These commands usually correspond to menu items.
Front End Tokens
Front end tokens let you perform kernel commands that would normally be done using the menus. Front end tokens are particularly convenient for writing programs to manipulate notebooks.
FrontEndToken is a kernel command that identifies its argument as a front end token. FrontEndExecute is a kernel command that sends its argument to the front end for execution. For example, the following command creates a new notebook.
FrontEndExecute can take a list as its argument, allowing you to execute multiple tokens in a single evaluation. When you evaluate the following command, the front end creates a new notebook and then pastes the contents of the clipboard into that notebook.

Simple and Compound Front End Tokens

Front end tokens are divided into two classes: simple tokens and compound tokens that take parameters.

Simple Tokens

For simple tokens, FrontEndToken can have one or two arguments.
If FrontEndToken has one argument, the token operates on the input notebook. The following examples use the front end token "Save". The result is the same as using File Save.
With two arguments, the arguments of FrontEndToken must be a NotebookObject and a front end token. For example, to save the notebook containing the current evaluation, the first argument of FrontEndToken is the notebook object EvaluationNotebook , and the second argument is the front end token "Save".
You can execute a simple, one-argument front end token with the command FrontEndTokenExecute[token]. This is equivalent to FrontEndExecute[FrontEndToken[token]].
For example, the following command will save the input notebook.

Compound Tokens

Compound tokens have a token parameter that controls some aspect of their behavior. For a compound token, the three arguments of FrontEndToken must be a NotebookObject, the front end token, and the selected token parameter.
For example, this saves the selected notebook as plain text.
Executing Notebook Commands Directly in the Front End
When you execute a command like NotebookWrite[obj,data] the actual operation of inserting data into your notebook is performed in the front end. Normally, however, the kernel is needed in order to evaluate the original command, and to construct the appropriate request to send to the front end. But it turns out that the front end is set up to execute a limited collection of commands directly, without ever involving the kernel.
version of NotebookWrite to be executed in the kernel
version of NotebookWrite to be executed directly in the front end
Distinguishing kernel and front end versions of commands.
The basic way that the Wolfram Language distinguishes between commands to be executed in the kernel and to be executed directly in the front end is by using contexts. The kernel commands are in the usual System` context, but the front end commands are in the FrontEnd` context.
send expr to be executed in the front end
Sending an expression to be executed in the front end.
Here is a blank notebook.


This uses kernel commands to write data into the notebook:


In the kernel, these commands do absolutely nothing:


If they are sent to the front end, however, they cause data to be written into the notebook:


If you write sophisticated programs for manipulating notebooks, then you will have no choice but to execute these programs primarily in the kernel. But for the kinds of operations typically performed by simple buttons, you may find that it is possible to execute all the commands you need directly in the front endwithout the kernel even needing to be running.
The Structure of Cells
a cell in a particular style
a cell with multiple styles
a cell with additional options set
Expressions corresponding to cells.
Here is a notebook containing a text cell and a Wolfram System input cell.


Here are the expressions corresponding to these cells.


Here is a notebook containing a text cell with the Wolfram System input inside.


This is the expression corresponding to the cell. The Wolfram System input is in a cell embedded inside the text.


plain text
text potentially in different styles, or containing cells
formatted Wolfram System expressions
graphics or sounds
text as generated by InputForm and OutputForm
unformatted expressions as obtained using Show Expression
an open group of cells
a closed group of cells
a style definition cell
Expressions representing possible forms of cell contents.
Styles and the Inheritance of Option Settings
the complete front end and all open notebooks
the current notebook
the style of the current cell
the specific current cell
a selection within a cell
The hierarchy of levels at which options can be set.
Here is a notebook containing three cells.


This is what happens when the setting CellFrame->True is made specifically for the third cell.


This is what happens when the setting CellFrame->True is made globally for the whole notebook.


This is what happens when the setting is made for the "Section" style.


In the standard notebook front end, you can check and set options at any level by using the Option Inspector menu item. If you do not set an option at a particular level, then its value will always be inherited from the level above. Thus, for example, if a particular cell does not set the CellFrame option, then the value used will be inherited from its setting for the style of the cell or for the whole notebook that contains the cell.
As a result, if you set CellFrame->True at the level of a whole notebook, then all the cells in the notebook will have frames drawn around themunless the style of a particular cell, or the cell itself, explicitly overrides this setting.
Choose the basic default styles for a notebook
Choose the styles for screen and printing style environments
Edit specific styles for the notebook
Ways to set up styles in a notebook.
Depending on what you intend to use your Wolfram System notebook for, you may want to choose different basic default styles for the notebook. In the standard notebook front end, you can do this by selecting a different stylesheet in the Stylesheet menu or by using the Edit Stylesheet menu item.
styles for everyday work and for reports
styles for colorful presentation of everyday work
styles for outlining ideas
styles for working with plain text documents
Some typical choices of basic default styles.
With each choice of basic default styles, the styles that are provided will change. Thus, for example, the Notepad stylesheet provides a limited number of styles since it is designed to work with plain text documents.
Here is a notebook that uses StandardReport default styles.


default value
the style environment to use for display on the screen
the style environment to use for printed output
Options for specifying style environments.
Within a particular set of basic default styles, the Wolfram System allows for two different style environments: one for display on the screen, and another for output to a printer. The existence of separate screen and printing style environments allows you to set up styles which are separately optimized both for lowresolution display on a screen, and highresolution printing.
onscreen working environment
onscreen environment for presentations
onscreen environment for maximum display density
onscreen environment for displaying slides
paper printout environment
Some typical settings for style environments.
The way that the Wolfram System actually sets up the definitions for styles is by using style definition cells. These cells can either be given in separate stylesheet notebooks, or can be included in the options of a specific notebook. In either case, you can access style definitions by using the Edit Stylesheet menu item in the standard notebook front end.
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.
typical default value
a dingbat to use to emphasize the cell
whether to draw a frame around the cell
the background color for the cell
whether to display the cell bracket
the magnification at which to display the cell
whether 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:


typical default value
outer margins in printer's points to leave around the contents of the cell
margins to leave inside the cell frame
list of rules
details of the layout of cell elements
how 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 Toolbar 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 {{left,right},{bottom,top}}. 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 CellElementSpacings. 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 CellElementSpacings:
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.


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


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


typical default value
a label for a cell
whether to show the label for a cell
whether to delete the label if the cell is modified
tags for a cell
whether to show tags for a cell
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.
typical default value
whether to allow a cell to be deleted interactively with the front end
whether to allow a cell to be copied
whether to allow the contents of a cell to be selected
whether to allow the contents of a cell to be edited
whether 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.
typical default value
the name of the kernel to use for evaluations
whether to allow the contents of a cell to be evaluated
whether to overwrite previous output when new output is generated
whether this cell was generated from the kernel
whether 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.
typical default value
whether to put a page break just above a particular cell
whether to allow a page break within a particular cell
whether to put a page break just below a particular cell
whether 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.
Text and Font Options
typical default value
how wide to assume the page to be
how to align successive lines of text
how much to allow lines of text to be stretched to make them fit
whether to allow hyphenation
how many printer's points to indent the first line in each paragraph
General options for text formatting.
If you have a large block of text containing no explicit newline characters, then the Wolfram System will automatically break your text into a sequence of lines. The option PageWidth specifies how long each line should be allowed to be.
the width of the window on the screen
the width of the page as it would be printed
an infinite width (no line breaking)
explicit width given in printer's points
Settings for the PageWidth option in cells and notebooks.
The option TextAlignment allows you to specify how you want successive lines of text to be aligned. Since the Wolfram System normally breaks text only at space or punctuation characters, it is common to end up with lines of different lengths. Normally the variation in lengths will give your text a ragged boundary. But the Wolfram System allows you to adjust the spaces in successive lines of text so as to make the lines more nearly equal in length. The setting for TextJustification gives the fraction of extra space which the Wolfram System is allowed to add. TextJustification->1 leads to "full justification" in which all complete lines of text are adjusted to be exactly the same length.
aligned on the left
aligned on the right
aligned at a position x running from -1 to +1 across the page
Settings for the TextAlignment option.
Here is text with TextAlignment->Left and TextJustification->0.


With TextAlignment->Center the text is centered.


TextJustification->1 adjusts word spacing so that both the left and right edges line up.


TextJustification->0.5 reduces the degree of raggedness, but does not force the left and right edges to be precisely lined up.


With Hyphenation->True the text is hyphenated.


When you enter a block of text in a Wolfram System notebook, the Wolfram System will treat any explicit newline characters that you type as paragraph breaks. The option ParagraphIndent allows you to specify how much you want to indent the first line in each paragraph. By giving a negative setting for ParagraphIndent, you can make the first line stick out to the left relative to subsequent lines.
leave space so that the total height of each line is c times the height of its contents
make the total height of each line exactly n printer's points
make the total height c times the height of the contents plus n printer's points
leave an extra space of c times the height of the font before the beginning of each paragraph
leave an extra space of exactly n printer's points before the beginning of each paragraph
leave an extra space of c times the height of the font plus n printer's points
Options for spacing between lines of text.
Here is some text with the default setting LineSpacing->{1,1}, which inserts just 1 printer's point of extra space between successive lines.


With LineSpacing->{1,5} the text is "looser".


LineSpacing->{2,0} makes the text doublespaced.


With LineSpacing->{1,-2} the text is tight.


typical default value
the family of font to use
a list of substitutions to try for font family names
the maximum height of characters in printer's points
the weight of characters to use
the slant of characters to use
the horizontal compression or expansion of characters
the color of characters
the color of the background for each character
Options for fonts.
text like this
text like this
text like this
Some typical font family names.
text like this
text like this
text like this
text like this
Some settings of font options.
The Wolfram System allows you to specify the font that you want to use in considerable detail. Sometimes, however, the particular combination of font families and variations that you request may not be available on your computer system. In such cases, the Wolfram System will try to find the closest approximation it can. There are various additional options, such as FontPostScriptName, that you can set to help the Wolfram System find an appropriate font. In addition, you can set FontSubstitutions to be a list of rules that give replacements to try for font family names.
There are a great many fonts available for ordinary text. But for special technical characters, and even for Greek letters, far fewer fonts are available. The Wolfram System system includes fonts that were built to support all of the various special characters that are used by the Wolfram System. There are three versions of these fonts: ordinary (like Times), monospaced (like Courier), and sans serif (like Helvetica).
For a given text font, the Wolfram System tries to choose the special character font that matches it best. You can help the Wolfram System to make this choice by giving rules for "FontSerifed" and "FontMonospaced" in the setting for the FontProperties option. You can also give rules for "FontEncoding" to specify explicitly from what font each character is to be taken.
Options for Expression Input and Output
typical default value
whether to indent after an explicit Return character is entered
the time in seconds to flash a delimiter when a matching one is entered
whether to show automatic style variations for syntactic and other constructs
whether an elliptical spot should appear momentarily to guide the eye if the cursor position jumps
whether to replace [Name] by a special character as soon as the ] is entered
whether to display " when a string is entered
whether to put singleletter symbol names in italics
whether to represent multiplication by a zero width character
additional EscnameEsc aliases to allow
strings to automatically replace on input
words to automatically put in italics
what category of language to assume a cell contains for spell checking and hyphenation
Options associated with the interactive entering of expressions.
The option SingleLetterItalics is typically set whenever a cell uses TraditionalForm.
Here is an expression entered with default options for a StandardForm input cell.


Here is the same expression entered in a cell with SingleLetterItalics->True and ZeroWidthTimes->True.


Built into the Wolfram Language are a large number of aliases for common special characters. InputAliases allows you to add your own aliases for further special characters or for any other kind of Wolfram Language input. A rule of the form "name"->expr specifies that EscnameEsc should immediately be replaced on input by expr.
Aliases are delimited by explicit Esc characters. The option InputAutoReplacements allows you to specify that certain kinds of input sequences should be immediately replaced even when they have no explicit delimiters. By default, for example, -> is immediately replaced by . You can give a rule of the form "seq"->"rhs" to specify that whenever seq appears as a token in your input, it should immediately be replaced by rhs.
human natural language such as English
Wolfram Language input
mathematical formula
do no spellchecking or hyphenation
Settings for LanguageCategory to control spellchecking and hyphenation.
The option LanguageCategory allows you to tell the Wolfram Language what type of contents it should assume cells have. This determines how spelling and structure should be checked, and how hyphenation should be done.
give options that apply to a particular grid box
give options that apply to all boxes in boxes
give options that apply to all boxes in contents
give default options settings for all GridBox objects in contents
Examples of specifying options for the display of expressions.
As discussed in "Textual Input and Output", the Wolfram Language provides many options for specifying how expressions should be displayed. By using StyleBox[boxes,opts] you can apply such options to collections of boxes. But the Wolfram Language is set up so that any option that you can give to a StyleBox can also be given to a complete Cell object, or even a complete Notebook. Thus, for example, options like Background and LineIndent can be given to complete cells as well as to individual StyleBox objects.
There are some options that apply only to a particular type of box, such as GridBox. Usually these options are best given separately in each GridBox where they are needed. But sometimes you may want to specify default settings to be inherited by all GridBox objects that appear in a particular cell. You can do this by giving these default settings as the value of the option GridBoxOptions for the whole cell.
For most box types named XXXBox, the Wolfram Language provides a cell option XXXBoxOptions that allows you to specify the default options settings for that type of box. Box types which take options can also have their options set in a stylesheet by defining the XXX style. The stylesheets which come with the Wolfram System define many such styles.
Options for Notebooks
Use the Option Inspector menu to change options interactively.
Use SetOptions[obj,options] from the kernel.
Use CreateWindow[options] to create a new notebook with specified options.
Ways to change the overall options for a notebook.
This creates a notebook displayed in a 40×30 window with a thin frame:
typical default value
the basic stylesheet to use for the notebook
the style environment to use for screen display
the style environment to use for printing
Style options for a notebook.
In giving style definitions for a particular notebook, the Wolfram System allows you either to reference another notebook, or explicitly to include the Notebook expression that defines the styles.
typical default value
how to group cells in the notebook
whether to show where page breaks would occur if the notebook were printed
whether to automatically save the notebook after each piece of output
General options for notebooks.
With CellGrouping->Automatic, cells are automatically grouped based on their style.


With CellGrouping->Manual, you have to group cells by hand.


typical default value
the default style for new cells created in the notebook
the default style for cells created by automatic duplication of existing cells
Options specifying default styles for cells created in a notebook.
The Wolfram Language allows you to take any cell option and set it at the notebook level, thereby specifying a global default for that option throughout the notebook.
typical default value
whether to allow cells in the notebook to be edited
whether to allow cells to be selected
whether to allow cells to be deleted
whether to show the current selection highlighted
what background color to use for the notebook
at what magnification to display the notebook
how wide to allow the contents of cells to be
A few cell options that are often set at the notebook level.
Here is a notebook with the Background option set at the notebook level.


typical default value
whether the window should be visible on the screen
the width and height of the window in printer's points
the margins to leave around the window when it is displayed on the screen
the type of frame to draw around the window
elements to include in the window
what title should be displayed for the window
whether the window should always float on top of other windows
whether the window should become selected if you click in it
a list of cells specifying the content of a docked area at the top of the window
Characteristics of the notebook window.
WindowSize allows you to specify how large you want a window to be; WindowMargins allows you to specify where you want the window to be placed on your screen. The setting WindowMargins->{{left,right},{bottom,top}} gives the margins in pixels to leave around your window on the screen. Often only two of the margins will be set explicitly; the others will be Automatic, indicating that these margins will be determined from the particular size of screen that you use.
WindowClickSelect is the principal option that determines whether a window acts like a palette. Palettes are generally windows with content that acts upon other windows, rather than windows that need to be selected for their own ends. Palettes also generally have a collection of other option settings such as WindowFloating->True and WindowFrame->"Palette".
DockedCells allows you to specify any content that you want to stay at the top of a window and never scroll offscreen. A typical use of the DockedCells option is to define a custom toolbar. Many default stylesheets have the DockedCells option defined in certain environments to create toolbars for purposes such as presenting slide shows and editing package files.
an ordinary window
a palette window
a modeless dialog box window
a modal dialog box window
an ordinary window with a thin frame
an ordinary window with no frame at all
a window with a generic border
Typical possible settings for WindowFrame.
The Wolfram System allows many different types of windows. The details of how particular windows are rendered may differ slightly from one computer system to another, but their general form is always the same. WindowFrame specifies the type of frame to draw around the window. WindowElements gives a list of specific elements to include in the window.
an area used to display status messages, such as those created by StatusArea
a popup menu of common magnifications
a scrollbar for horizontal motion
a scrollbar for vertical motion
Some typical possible entries in the WindowElements list.
Here is a window with a status area and horizontal scrollbar, but no magnification popup or vertical scrollbar.


Global Options for the Front End
In the standard notebook front end, the Wolfram System allows you to set a large number of global options. The values of all these options are by default saved in a "preferences file", and are automatically reused when you run the Wolfram System again. These options include all the settings which can be made using the Preferences dialog.
style definitions
default style definitions to use for new notebooks
file locations
directories for finding notebooks and system files
data export options
how to export data in various formats
character encoding options
how to encode special characters
language options
what language to use for text
message options
how to handle messages generated by the Wolfram System
dialog settings
choices made in dialog boxes
system configuration
private options for specific computer systems
Some typical categories of global options for the front end.
You can access global front end options from the kernel by using Options[$FrontEnd,name]. But more often, you will want to access these options interactively using the Option Inspector in the front end.