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 /  Input and Output in Notebooks /

11.9 Forms of Input and Output

Mathematica TE notebooks allow you to give input and get output in a variety of different forms. Typically the front end provides menu commands for converting cells from one form to another.

Forms of input and output.

The input here is typed in InputForm but the output is in StandardForm.

In[1]:= x^2 + y^2/z

Out[1]=

Here is a version of the input entered using two-dimensional math notation, as explained in Section 11.2.

In[2]:=

Out[2]=

InputForm is the most general form of input for Mathematica TE: it works whether you are using a notebook interface or a text-based interface.

With a notebook interface, output is by default produced in StandardForm.

In[3]:= Sqrt[x] + 1/(2 + Sqrt[y])

Out[3]=

With a notebook interface, the default form for both input and output is StandardForm. The basic idea of StandardForm is to provide a precise but elegant representation of Mathematica TE expressions, making use of special characters, two-dimensional positioning, and so on.

Both input and output are given here in StandardForm.

In[5]:=

Out[5]=

An important feature of StandardForm is that any output you get in this form you can also directly use as input. You can even copy and paste output into an Input cell and evaluate it.

In[6]:=

Out[6]=

The precise nature of StandardForm prevents it from following all of the somewhat haphazard conventions of traditional mathematical notation. Mathematica TE however also supports TraditionalForm, which uses a large collection of rules to give a rather complete rendition of traditional mathematical notation. To see a cell in TraditionalForm, you must use the appropriate front end commands, usually located in the Cell menu..

After the evaluation, the output cell bracket was selected and changed to TraditionalForm using the command Cell RightTriangle Convert To RightTriangle TraditionalForm. Once converted, the cell bracket is jagged. Notice that TraditionalForm uses lowercase names for functions, and puts arguments in parentheses rather than square brackets.

In[7]:=

Out[7]=

TraditionalForm is often useful for generating output that can be inserted directly into documents that use traditional mathematical notation. But you should understand that TraditionalForm is intended primarily for output; it does not have the kind of precision that is needed to provide reliable input to Mathematica TE. The ambiguities of TraditionalForm make it in general unsuitable for specifying input to the Mathematica TE kernel. But at least for sufficiently simple cases, Mathematica TE does include various heuristic rules for trying to interpret TraditionalForm expressions as Mathematica TE input.

Cells intended for input to the kernel are assumed by default to contain StandardForm expressions.

Here the front end was specifically told that input would be given in TraditionalForm. The cell bracket has a jagged line to indicate the difficulties involved.

Some situations in which TraditionalForm input can be expected to work.

Whenever Mathematica TE generates an expression in TraditionalForm, it automatically inserts various hidden tags so that the expression can later be interpreted unambiguously if it is given as input. And even if you edit the expression, the tags will often be left sufficiently undisturbed that unambiguous interpretation will still be possible. If you enter a TraditionalForm expression from scratch, or import it from outside Mathematica TE, then Mathematica TE will still do its best to guess what the expression means. When there are ambiguities, it typically assumes that you are using notation in whatever way is more common in elementary mathematical applications.

You should realize that TraditionalForm does not provide any kind of precise or complete way of specifying Mathematica TE expressions. Nevertheless, for some elementary purposes it may be sufficient, particularly if you use a few additional tricks.

A few tricks for TraditionalForm input.