1.10.2 Entering Two-Dimensional Input
When Mathematica reads the text x^y, it interprets it as x raised to the power y.
In a notebook, you can also give the two-dimensional input directly. Mathematica
again interprets this as a power.
One way to enter a two-dimensional form such as into a Mathematica
Here is a palette for entering some common two-dimensional notations.
notebook is to copy this form from a palette by clicking the appropriate button in the palette.
There are also several ways to enter two-dimensional forms directly from the keyboard.
Ways to enter a superscript directly from the keyboard. stands for Control-Space.
You type ^ by holding down the Control key, then hitting the ^ key. As soon as you do this, your cursor will jump to a superscript position. You can then type anything you want and it will appear in that position.
This sequence of keystrokes enters
When you have finished, press to move back down from the superscript position. stands for Control-Space; you type it by holding down the Control key, then pressing the space bar.
Here the whole expression y+z is in the superscript.
Pressing (Control-Space) takes you down from the superscript.
You can remember the fact that ^ gives you a superscript by thinking of ^ as just a more immediate form of ^. When you type x^y, Mathematica will leave this one-dimensional form unchanged until you explicitly process it. But if you type x^y then Mathematica will immediately give you a superscript.
This is an alternative input form that avoids the use of control characters.
On a standard English-language keyboard, the character ^ appears as the shifted version of 6. Mathematica therefore accepts 6 as an alternative to ^. Note that if you are using something other than a standard English-language keyboard, Mathematica will almost always accept 6 but may not accept ^.
In:= \!\( x \^ y \)
With this input form, Mathematica automatically understands that the +z does not go in the superscript.
In:= \!\( x \^ y + z \)
Using control characters minimizes the number of keystrokes that you need to type in order to enter a superscript. But particularly if you want to save your input in a file, or send it to another program, it is often more convenient to use a form that does not involve control characters. You can do this using \! sequences.
When entered from the keyboard \( ... \) sequences are shown in literal form.
If you copy a \! sequence into Mathematica, it will automatically jump into two-dimensional form. But if you enter the sequence directly from the keyboard, you explicitly need to choose the
menu item in order to get the two-dimensional form.
item in the
menu converts these sequences into two-dimensional forms.
Ways to enter a subscript directly from the keyboard.
Subscripts in Mathematica work very much like superscripts. However, whereas Mathematica automatically interprets as x raised to the power y, it has no similar interpretation for . Instead, it just treats
This enters y as a subscript.
as a purely symbolic object.
Here is another way to enter y as a subscript.
In:= \!\( x \_ y \)
This enters the built-up fraction
Ways to enter a built-up fraction directly from the keyboard.
Here the whole y+z goes into the denominator.
But pressing Control-Space takes you out of the denominator, so the +z does not appear in the denominator.
Mathematica automatically interprets a built-up fraction as a division.
Here is another way to enter a built-up fraction.
In:= \!\( 8888 \/ 2222 \)
This enters a square root.
Ways to enter a square root directly from the keyboard.
Control-Space takes you out of the square root.
Here is a form without control characters.
In:= \!\( \@ x + y \)
And here is the usual one-dimensional Mathematica input that gives the same output expression.
In:= Sqrt[x] + y
This puts both a subscript and a superscript on x.
Special input forms based on control characters. The second forms given should work on any keyboard.
Here is another way to enter the same expression.
You must preface the outermost \( with \!.
Special input forms that generate two-dimensional input with the Make 2D menu item.
In:= \!\(a \/ b + \@ c \) + d
You can use \( and \) to indicate the grouping of elements in an expression without introducing explicit parentheses.
In:= \!\(a \/ \( b + \@ c \) \) + d
In addition to subscripts and superscripts, Mathematica also supports the notion of underscripts and overscriptselements that go directly underneath or above. Among other things, you can use underscripts and overscripts to enter the limits of sums and products.
Creating underscripts and overscripts.