2.11.8 Styles and the Inheritance of Option Settings
| Global | the complete front end and all open notebooks | | Notebook | the current notebook | | Style | the style of the current cell | | Cell | the specific current cell | | Selection | 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 them--unless 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 Mathematica notebook for, you may want to choose different basic default styles for the notebook. In the standard notebook front end, you can do this using the Edit Style Sheet menu item.
| "Report" | styles for everyday work and for reports | | "Tutorial" | styles for tutorial-type material | | "Book" | styles for books such as this one |
Some typical choices of basic default styles. With each choice of basic default styles, the styles that are provided will change. Thus, for example, only in the Book default styles is there a Box style which sets up the gray boxes used in this book. | Here is a notebook that uses Book default styles. | | 
|
| option | default value | | | ScreenStyleEnvironment | "Working" | the style environment to use for display on the screen | | PrintingStyleEnvironment | "Printout" | the style environment to use for printed output |
Options for specifying style environments. Within a particular set of basic default styles, Mathematica 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 low-resolution display on a screen, and high-resolution printing.
| "Working" | on-screen working environment | | "Presentation" | on-screen environment for presentations | | "Condensed" | on-screen environment for maximum display density | | "Printout" | paper printout environment |
Some typical settings for style environments. | Here is a notebook with the usual Working screen style environment. | | 
|
| Here is the same notebook with the Condensed screen style environment. | | 
|
The way that Mathematica actually sets up the definitions for styles is by using style definition cells. These cells can either be given in separate style definition notebooks, or can be included in the options of a specific notebook. In either case, you can access style definitions by using the Edit Style Sheet menu item in the standard notebook front end.
| "name.nb" | get definitions from the specified notebook | { , , ... } | get definitions from the explicit cells given |
Settings for the StyleDefinitions option for a Notebook. | Here is an example of a typical style definition cell. | | 
|
| This is the expression corresponding to the cell. Any cell in Section style will inherit the option settings given here. | | 
|
| Cell[StyleData["style"], options] | a cell specifying option settings for a particular style |
Cell[StyleData["style", "env"], options]
| | a cell specifying additional options for a particular style environment |
Expressions corresponding to style definition cells.
|