unit with its own properties (format, evaluable cell, etc.). To see the cell type, place the cursor
inside or on the cell marker. The type will appear in the style box (Figure, Input, Text, Title,
Program...). We can also change the format directly inside the box. Type in a text cell and try
to change its style.
ThisisacellformattedusingtheProgramstyle.
When a blank notebook is created, it has a style (cell types, fonts, etc.) that assigns to each type
of cell certain properties (evaluable, editable, etc). The first time a notebook is created,
Mathematica assigns a style named Default (by default). Later on we will see how to choose
different styles. In the Default style, when a new cell is created, it will be of the Input type,
which is the one used normally for calculations. When we evaluate an Input type cell, “In[n]:=
our calculation” will be shown and a new cell of type Output will be generated where you will
see the calculation result in the form of “Out[n]:= result” (n showing the evaluation order).
However, in this book we sometimes use an option to omit the symbols “In[n]:=” and
“Out[n]:=”. These and other options to customize the program can be accessed through Edit ▶
Preferences ....
To execute an Input cell select the cell (placing the cursor on the cell marker) and press
+ or on the numeric keypad. You can also access the contextual menu by
right-clicking with the mouse and selecting “Evaluate Cell”.
2 +2
4
Figure 1.3 The Suggestions Bar.
Since Mathematica 9, when a cell is executed, a toolbar appears below its output as shown
above (Figure 1.3). This bar, named the Suggestions Bar, provides immediate access to
possible next steps optimized for your results. For example, If you click on range you will see
that a new input is being generated and a new suggestions bar will appear right below the
result:
Range[4]
{1, 2, 3, 4}
The Suggestions Bar is part of the predictive interface. It tries to guide you with suggestions
to simplify entries and ideas for further calculations. It is one more step to reduce the time it
takes to learn how to use the program.
All written instructions inside a cell will be executed sequentially. If at the end of an
instruction we type semicolon ";", the instruction will be executed but its output will not be
shown. This is useful to hide intermediate results. In an evaluation cell (Input) we can include
one or more comments, writing them in the following format: (* comment *). Nevertheless, it
is recommended to include the comments in separate cells in text format. Remember that you
can do that by choosing Text in the style box.
To create a new cell we just need to place the cursor below the cell where we are and then start
writing. We can also create a new cell where the cursor is located by pressing +.
To facilitate writing, Mathematica provides Palettes. These can be loaded by clicking on
Palettes in the menu bar. There are several palettes to make it easier to type mathematical
6 Mathematica beyond mathematics