How Do I Add a New Style Environment?

Paul Wellin

Wolfram Research, Inc.

A simple way to create new styles and style sheets is to modify an existing style sheet. Here is an example.

  • Create a new notebook and select Edit Style Sheet... from the Format menu. Click the "Import Private Copy" button on the "Import Styles for..." dialog box. This imports a copy of the default style sheet into the notebook and preserves the original style sheet.
  • Open the "Style Environment Names" section by double-clicking the cell group bracket. You'll see four environments listed: Working, Presentation, Condensed, and Printout.
  • In this example, we'll use the Condensed environment as a template to create other styles. (It is assumed that you don't need the Condensed environment. If you do need the Condensed environment, then instead of renaming it and editing its contents, paste a copy of the entire Condensed environment and rename the copy. You will need to do the same for each of the following steps as well.) Select the cell bracket for the Condensed environment, and select Format->Show Expression from the menus (SHIFT-CONTROL-E). You should see the following.

    Cell[StyleData[All, "Condensed"],
    CellLabelMargins->{{8, Inherited}, {Inherited, Inherited}},
    Change this to:

    Cell[StyleData[All, "LargeFormat"],
    CellLabelMargins->{{8, Inherited}, {Inherited, Inherited}},
  • Select this cell, and format it by selecting Show Expression again (or press SHIFT-CONTROL-E again).

Now you have a new environment called LargeFormat. For each cell style prototype, you will need to rename Condensed as LargeFormat and to edit the cell prototype so that fonts are bigger, line spacing is adjusted appropriately, etc.

For example, change the Condensed Title cell style from:

Cell[StyleData["Title", "Condensed"],
CellMargins->{{8, 10}, {4, 8}},

Cell[StyleData["Title", "LargeFormat"],
CellMargins->{{24, 10}, {20, 40}},
LineSpacing->{1, 0},

When you are done doing this for each of the cell styles, make sure that you have reformatted each cell by toggling off Show Expression for each of the cells you edited. Save this notebook as LargeFormat.nb (or whatever new name you like) in $TopDirectory/SystemFiles/FrontEnd/StyleSheets.

Font size for each cell style is a matter of personal preference, but there are a few things you might want to keep in mind.

  • As you make a font larger, it is a good idea to increase line spacing a bit to maintain readability. This is especially important for text in paragraphs and display equations.
  • Sans serif fonts are generally easier for the visually impaired to read than serif fonts.

All editing will need fine-tuning to get the look that you want. Once you have it, however, you can set this as the default style sheet used by Mathematica.

To do this, make a copy of the Default.nb style sheet, and save LargeFormat.nb in its place as Default.nb. The next time you start a new Mathematica session, this style sheet will be used as the default. In addition, you can set LargeFormat as the default environment. To do this, follow these steps.

  • Open up the Option Inspector.
  • Set "Show option values for" to "global."
  • Type ScreenStyleEnvironment in the Lookup text field, and click the Lookup button.
  • Change the value from "Working" to "LargeFormat".