Basic Tutorial (Part 5 of 8) : The Notebook Front End
Basic Tutorial (Part 5 of 8) : The Notebook Front End
Basic Tutorial (Part 5 of 8) : The Notebook Front End
5 Using Notebooks
In this part of the basic tutorial you will learn about:
Style Sheets
Which styles are available and how cells in those styles are displayed is determined by a notebook's
style sheet. A style sheet is itself a notebook that contains style definitions. Different style sheets
will cause the cells of a notebook to display or print or be grouped in different ways. You can change
the style sheet for a notebook to one of built-in style sheets by choosing it from the Style Sheet
submenu of the Format menu. Most built-in style sheets define a common set of styles, but each
has some unique styles too.
All of the built-in style sheets are shared style sheets. Notebooks that get their styles from a shared
style sheet need only store the name of that style sheet. Every time such a notebook is opened, the
notebook front end reads the shared style sheet from your hard drive to determine how to display
the notebook. Shared style sheets are useful if you want a collection of notebooks to use the same
style sheet.
The opposite of a shared style sheet is a local or private style sheet. A private style sheet is stored
within the notebook that uses it, and no other notebook can access those style definitions. You
might use a private style sheet if you are sending your work to someone and want to send a single
notebook instead of a notebook and your custom shared style sheet.
Untitled-2
The opposite of a shared style sheet is a local or private style sheet. A private style sheet is stored3
within the notebook that uses it, and no other notebook can access those style definitions. You
might use a private style sheet if you are sending your work to someone and want to send a single
notebook instead of a notebook and your custom shared style sheet.
To get a private copy of a shared style sheet into your notebook, choose Edit Style Sheet... from the
Format menu. You can also use that menu item to edit a shared style sheet. When editing a shared
style sheet, make sure to save your changes. To discard a private style sheet, choose a shared
style sheet to replace it.
Style sheets can define styles which are used as section heads, automatically numbered equations,
or any other logical or stylistic markup. See the online help for more information on style sheets.
Exercises
Exercise 5.1 Set up a new notebook
Start a new notebook that uses the Article Classic style sheet. Among other things the Article Clas-
sic style sheet includes styles for numbered equations, which will be used in a subsequent exercise.
Type Exercise 5 into the notebook and change the style of the cell to Title.
If the window title does not change, check that the new notebook is selected. The name of the new
notebook, which will normally be an Untitled notebook before the change, should appear to the right
of Window at the top of the Option Inspector window. Check also that Scope is set to notebook.
y ã 9 - 5 x + x^2
y ã 1+x
Set the style for these cells to NumberedEquation. A number for each equation should appear in
parentheses near the right side of the notebook.
The equations are automatically numbered in order. If you change the style of the first equation
back to Input, for example, or remove the first equation, the numbers for the other two equations will
be updated automatically.
Styles for numbered equations, tables, figures, and other notebook elements are included in all of
the following style sheets.
ArticleClassic ArticleModern
Classic Classroom
HelpBrowser Report
In the Solution section of the new notebook, in a new cell, enter the text "The solution to equations (
) and ( ) can be computed using the Solve function." and set the style of the new cell to Text. The
parentheses will be filled in later with references to the equations.
Type Solve@8y ã 9 - 5 x + x^2, y ã 1 + x<, 8x, y<D into a new cell below the sentence that
you just entered and evaluate this input to get the solutions of this pair of equations.
The cell tags set up in the previous exercise are necessary for the following exercise to work.
Position the cursor between the first pair of parentheses in the sentence that you entered at the start
of this exercise. Select Create Automatic Numbering Object from the Input menu, and use the
dialog box to select the NumberedEquation counter type and the cell with tag quadratic equation.
When you are finished, click OK to dismiss the dialog box. A number corresponding to the equation
with the matching cell tag should appear at the position of the cursor.
Repeat this process with the cursor between the second pair of parentheses and select NumberedE-
quation and the linear equation cell tag in the dialog box.
The equation numbers that appear between the parentheses in this sentence are updated automati-
cally to match the numbers of the corresponding equations. Clicking the numbers will highlight the
corresponding cell. Automatic updating of equation numbers is useful if you are working on a large
document and want to be sure that the numbers in the text always match the numbers on the
equations, even when equations are inserted, removed, or rearranged.
To test that automatic updating of numbering is working correctly, try changing the style of the first
equation to something other than NumberedEquation, or try inserting another NumberedEquation
cell before the two tagged cells. The numbers in the equation cells and the numbers in the sentence
that you entered should be updated to reflect any changes.
To test that hyperlinks to the corresponding NumberedEquation cells are working correctly, try
clicking the numbers in the sentence that you entered. The selection should jump to the cell that
contains the corresponding equation and the cell bracket should be highlighted.
Finally, link the word Solve to the help browser entry for the function Solve.