Professional Documents
Culture Documents
6 Typeset Editing
In this part of the Basic Tutorial you will learn about:
You can also enter your input using typeset notations. For example, you could enter 3 rather
than Sqrt@3D. One way to enter 3 is to press ‚Î@Ï (press the @ key while holding down the
control key) and then type 3. You can then evaluate that input just as you would evaluate any other
input.
3
Mathematica can also display a variety of characters commonly used in mathematics and engineer-
ing, such as greek characters, which you can use in your input. Just as with built-in functions, some
characters like p have special meaning when used in input.
Sin@q + 2 pD
Ñ
The Ñ and É squares in this palette designate places where you can insert your own data. The
outlined square, Ñ, is called a placeholder. Use the tab key to move from one placeholder to the
next in a typeset expression. Typing when a placeholder is selected will replace the placeholder with
what you type.
The black square, É, is called a selection placeholder. If you have some input selected when you
click a button, your selected input will be filled in where the selection placeholder is. This lets you
apply typesetting to part or all of your existing input. If there is no selection placeholder, your data
will be replaced by the button's data.
For example, you can click the fraction button,
Ñ
Ñ
fill in the placeholders,
1
Sin@qD
select the fraction, and click the square root button to create something like this.
1
Sin@qD
For more information on using palettes, see the “Mathematica How To” related to palettes.
The BasicMathInput palette provides you with the most commonly used typeset forms: superscripts,
subscripts, fractions, roots, matrices, and common characters. Other built-in palettes
(WritingAssistant, SpecialCharacters, BasicTypesetting), give more extensive libraries of preformat-
ted typeset forms. In the next section, we look at how to create arbitrary typeset forms from the
keyboard.
Subscript ÑÑ ‚Î - Ï
Ñ
Above Ñ ‚Î7Ï
Below Ñ ‚Î + Ï
Ñ
Ñ
Add Row ‚ÜÁ
Ñ
Add Column HÑ Ñ L ‚Î, Ï
Ñ
ÑÑÑ , Ñ
Ñ
Opposite Position Ñ, ‚Î5Ï
Ñ
For more assistance with keyboard shortcuts for typeset expressions, see the Mathematica tutorial
for Input Sintax.
To type a special character such as p into you notebook, you usually will type the two characters '\['
followed by the character's name, and then a closing ']'. As you type the closing bracket, the string
of characters you typed will be automatically replaced by the corresponding special character. You
can see all the special characters and their names in the Documention Center. For example, typing
\ [Pi] results in a p character, while \ [GothicCapitalZ] yields Zℨ.
Many special characters have aliases you can use to type them more quickly, but they are a little
more difficult to remember. To type a character using its alias, press  (the escape key), type the
alias, and then press  again to complete the character. For example, p can also be typed as
ÂpÂ, and Zℨ as ÂgoZÂ. Again, see the Documentation Center to learn character aliases. If you
are familiar with the names given to these characters in HTML, TEX, or SGML, you may find that the
name is an alias to the character in Mathematica.
Creating palettes
You may find it useful to create palettes that contain typeset forms you use most often. This can be
done either programmatically with the with the CreatePalette Mathematica functionor from a selec-
tion with the Generate Palette from Selection submenu item in the Palettes menu. For more details
please see the tutorial in the Documentation Center.
1
Sin@qD
You can also edit the Cell expression. When you toggle back to the formatted version, your
changes will be reflected in the display. For example, select the above cell and choose 14 point
from the Size submenu of the Format menu. This changes the display and so it must have changed
something about the Cell expression. Using Show Expression, you see that selecting a new point
size simply adds an option to the cell, namely FontSize->14. You can change this number manu-
ally and toggle back to the formatted cell to view your changes.
Within a cell, the subexpression representing a piece of typesetting has a name that usually ends in
"Box", so they are sometimes collective known as typesetting boxes. Typesetting boxes have
options too. For example, if you look at the cell expression underlying a two-dimensional table such
as
1 2 3
4 5 6
7 8 9
you will see this is stored as
GridBox@881, 2, 3<, 84, 5, 6<, 87, 8, 9<<D
Some options for GridBox control whether to draw a frame around the outside of the grid
(GridFrame), whether to draw lines between the rows (RowLines) or columns (ColumnLines), and
how to align the content of each column (ColumnAlignments). You can alter these options by
interacting with the option inspector, or you can directly alter the cell expression to contain
GridBox@881, 2, 3<, 84, 5, 6<, 87, 8, 9<<,
GridFrame -> 2, RowLines -> 1D
The display should change accordingly.
You can browse the options available in the various typesetting boxes in the option inspector tutorial.
Exercises
Exercise 6.1 Entering a typeset expression
Enter the equation z == Sqrt@x^2 + y^2D using Ñ notation for the square root and superscripts
for the exponents. The result should look like z == x2 + y2 .
q+ 1-2b
q+ 1+b
Basic6.nb 5
Then, create a GridBox expression with the option ColumnAlignments->"." as another way to do
accomplish the alignment. Use DisplayForm to display the grid.
LimitBBesselJ@0, xD + x , x Ø 10F
Finally, modify the following input so that the label is J0 HxL + x and change the coordinates of the
label so that it does not fall on top of the line in the plot.
3.0
2.5
2.0 x + BesselJ@0, xD
1.5
2 4 6 8 10