Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  The Teacher's Book /  Basic Calculations /  Running Mathematica /

1.3 Entering Input

In a notebook interface, your Mathematica TE input and output appear as elements in the notebook document, potentially mixed with text and graphics. A complete notebook can look much like this book. It can contain specific pieces of Mathematica TE input and output, analogous to the dialogs in this book, together with explanatory text, graphics, and so on.
All the material in a notebook is organized into a sequence of cells. Each cell contains text or other material that is to be treated as some kind of unit. Thus, for example, each complete piece of Mathematica TE input occupies its own cell. When you evaluate the input, Mathematica TE automatically generates a new cell to be used for the output.
Within a particular cell, you can typically use any of the standard positioning and editing capabilities of the graphical user interface for your computer system. A piece of Mathematica TE input within a single cell may go on for several lines. Thus, for example, pressing the Return key when you are typing input into a particular cell simply goes to the next line in the cell. It does not tell the Mathematica TE front end that you have finished giving input in that cell.
In most notebook interfaces, you tell Mathematica TE that you have finished preparing input for it in a particular cell by pressing ShiftKey KeyBar ReturnKey or EnterKey. When you do this, all the text in your current cell is given as input to the Mathematica TE kernel.

Terminating your input with a notebook interface.

Mathematica TE requires that the input you give follow a definite syntax. Input like 4 +/ 5 does not follow the syntax, and cannot be processed by Mathematica TE. If you give input like this, Mathematica TE will reject it. Typically it will make your computer beep, then put you at the point in your current input cell where it first encountered a problem. You can then edit the material in the cell, and press ShiftKey KeyBar ReturnKey or EnterKey to resend it to Mathematica TE.
When you are first entering text in a particular notebook cell, the Mathematica TE front end does not yet know whether the text you give is intended to be actual Mathematica TE input. It is only when you press ShiftKey KeyBar ReturnKey or EnterKey that it can tell. As a result, it is only at this point that the front end labels your input with In[n]:=. In addition, if you ever go back and edit the cell, the label automatically disappears.
In general, notebook interfaces allow you to move around in, edit and annotate the "history" of your Mathematica TE session. As a result, the sequence of input and output lines that you gave to Mathematica TE may not appear in your notebook in the order in which they were given. In this case, only the In[n]:= and Out[n]= labels tell you the actual sequence that was used.
Notebook interfaces typically provide various features to reduce the amount of typing involved in entering Mathematica TE input. One standard feature is command completion. If you type part of a name known to Mathematica TE, you can ask your notebook interface to complete the name. If there is a unique completion, it is done. Otherwise, you get a menu of possible completions.
There are also various parameters, particularly graphical ones, that notebook interfaces typically allow you to choose using graphical tools. For example, many notebook interfaces allow you to choose the view point for a three-dimensional plot by interactively rotating a three-dimensional box. When you have found the view point you want, the front end generates the appropriate text to specify this view point in Mathematica TE.

By rotating the box, you can specify a view point, which is then fed to Mathematica TE in textual form.

Another graphical feature common in notebook interfaces is the ability to read coordinates from graphs using a pointing device such as a mouse. You can also usually enter new points, whose coordinates you can get in textual form as Mathematica TE input.

Notebook interfaces typically allow you to find and specify coordinates graphically.