Style sheets are a large topic. WRI has a bunch of them but each one I've examined seems to have some quirky and objectionable feature. So many of us are left with rolling our own style sheets. I want to discuss how to do various things and also some of the issues that I think are important in style sheet design. (Most of the features I discuss here are in the Presentations Application (which I sell) style sheets but you can fairly easily incorporate most of them yourself.)
The first question to address is: where are you going to put your custom style sheets? The answer is to create a YourNameStuff folder in your $UserBaseDirectore/Applications folder. (You might also put packages containing useful custom routines in the YourNameStuff folder.) Then add the following folder structure:
and put your style sheets in the StyleSheets folder. They will then automatically appear in the Mathematica/Menu/Format/Stylesheet menu. However, if you have a number of style sheets with disparate names they will end up scattered all over the menu. It is better to have all your style sheets grouped together. Also you might want to zip your entire folder and send it to a colleague and then it will be scattered all over their menu. So a better way is to create the folder structure:
and put the style sheets there. They will then all be grouped together and take up only one slot on the main Format menu.
Next task is then to create a starting point style sheet.
- Go to the Wolfram Research/Mathematica/9.0/SystemFiles/FrontEnd/StyleSheets and copy the Default.nb.
- Paste it into your stylesheet folder.
- Rename it to YourNameStyle.nb
- Close and reopen Mathematica. The style sheet should now appear on your Menu/Format/Stylesheet menu.
Bring up your new style sheet. Bring up the OptionInspector, set the Selection to your style notebook, and in Notebook Options/FileOptions set Editable to True and Apply. To save your stylesheet use SaveAs (Save won't work and won't tell you it doesn't work!) Save it under its present name.
You may want to bring up a notebook with various cell types in it so you can observe any changes in the notebook.
There are several methods to edit a style. One method is to select a cell type in the style sheet and use the Mathematica Format menu. However, I generally make changes by editing the underlying expression for the cell type.
For example: Go to "Styles for Title and Section Cells", "Section" and expand and select the first Section group. Then open up the underlying expression by using Shift+Ctrl+E. (And later close it the same way.) Look toward the end of the expression and you will see FontFamily, FontSize and FontColor. You can change these options as you desire. You can't use Black for FontColor. Use RGBColor[0,0,0].
Go to "Styles for Body Text", "Bulleted" and open the Item style in the same way. There you will see a CellDingbat option. Change the RGBColor. Etc. Looking at the WRI underlying expressions will give a good idea of the mechanics.
As for some issues of style:
- There should not be too great a gradation of font sizes between Title and Text. WRI usually overdoes it.
- All default text should be Black.
- To make a notebook that looks something like a paper or book, Text and Output cells should look alike, have the same font size and be unadorned. Input cells might have a slight background color. If an Input cell is closed then the text and output blend smoothly together.
- Generally resist the urge to add adornment. It's not very value added and just detracts from the content.
- All the Section and the various sub-Sections should have group openers. Then you can collapse the notebook to outline form. Some readers may not know to double click the cell brackets, especially if they don't see them. Other groupings shouldn't have openers. You can add the group openers to a cell style by adding the option ShowGroupOpener->True.
A couple of things I've added in Presentations:
- I don't like the little "Choose Input Type" doo-dad at the main new cell entry point. It's easy enough to bring up Wolfram|Alpha anyway and I only very occasionally use it. If you don't want it you can get rid of it by adding CellInsertionPointCell->None to the Notebook Options Settings, Notebook style.
- In Presentations itself I've added a command to paste in an "Eval" button into a Text cell. It will evaluate a permanently closed cell just below it, and has a Tooltip explaining its purpose. This way you can include a long boilerplate specification directly in a running discussion, hide it, but make certain it's not overlooked by a reader.
- I've added section reset styles at various levels. They allow you to include subsections at any point, close them, and continue on at the previous level.
I hope this will be of some help for creating your own style sheets.