Styles and the Inheritance of Option Settings

The hierarchy of levels at which options can be set.

Here is a notebook containing three cells.

This is what happens when the setting (RefLink[CellFrame, paclet:ref/CellFrame])->(RefLink[True, paclet:ref/True]) is made specifically for the third cell.

This is what happens when the setting (RefLink[CellFrame, paclet:ref/CellFrame])->(RefLink[True, paclet:ref/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 (MenuGrayLink[Option Inspector, paclet:ref/menuitem/OptionInspector]) 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 (RefLink[CellFrame, paclet:ref/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 (RefLink[CellFrame, paclet:ref/CellFrame])->(RefLink[True, paclet:ref/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.

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 (MenuGrayLink[Stylesheet, paclet:ref/menuitem/Stylesheet]) menu or by using the (MenuGrayLink[Edit Stylesheet, paclet:ref/menuitem/EditStylesheet]) menu item.

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.

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 low-resolution display on a screen, and high-resolution printing.

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 (MenuGrayLink[Edit Stylesheet, paclet:ref/menuitem/EditStylesheet]) menu item in the standard notebook front end.