3.10.2 Names of Symbols and Mathematical Objects
Mathematica by default interprets any sequence of letters or letter-like forms as the name of a symbol.
|All these are treated by Mathematica as symbols. || |
Symbols with built-in meanings whose names do not start with capital English letters.
|form ||character name ||alias ||interpretation |
| ||\[Pi] ||p, pi ||equivalent to Pi |
| ||\[Infinity] ||inf ||equivalent to Infinity |
| ||\[ExponentialE] ||ee ||equivalent to E |
| ||\[ImaginaryI] ||ii ||equivalent to I |
| ||\[ImaginaryJ] ||jj ||equivalent to I |
Essentially all symbols with built-in meanings in Mathematica have names that start with capital English letters. Among the exceptions are and , which correspond to E and I respectively.
|Forms such as are used for both input and output in StandardForm. || |
|In OutputForm is output as E. || |
In written material, it is standard to use very short names--often single letters--for most of the mathematical objects that one considers. But in Mathematica, it is usually better to use longer and more explicit names.
In written material you can always explain that a particular single-letter name means one thing in one place and another in another place. But in Mathematica, unless you use different contexts, a global symbol with a particular name will always be assumed to mean the same thing.
As a result, it is typically better to use longer names, which are more likely to be unique, and which describe more explicitly what they mean.
For variables to which no value will be assigned, or for local symbols, it is nevertheless convenient and appropriate to use short, often single-letter, names.
|It is sensible to give the global function LagrangianL a long and explicit name. The local variables can be given short names. || |
Creating objects with annotated names.
|form ||input ||interpretation |
| ||x_n or x\_n ||Subscript[x, n] |
| ||x_+ or x\_+ ||SubPlus[x] |
| ||x_- or x\_- ||SubMinus[x] |
| ||x_* or x\_* ||SubStar[x] |
| ||x^+ or x\^+ ||SuperPlus[x] |
| ||x^- or x\^- ||SuperMinus[x] |
| ||x^* or x\^* ||SuperStar[x] |
| ||x^dg or x\^\[Dagger] ||SuperDagger[x] |
| ||x&_ or x\&_ ||OverBar[x] |
| ||x&vec or x\&\[RightVector] ||OverVector[x] |
| ||x&~ or x\&~ ||OverTilde[x] |
| ||x&^ or x\&^ ||OverHat[x] |
| ||x&. or x\&. ||OverDot[x] |
| ||x+_ or x\+_ ||UnderBar[x] |
|x ||StyleBox[x, FontWeight->"Bold"] ||x |
Note that with a notebook front end, you can typically change the style of text using menu items. Internally the result will be to insert StyleBox objects, but you do not need to do this explicitly.
An option for cells in a notebook.
|option ||typical default value |
|SingleLetterItalics ||Automatic ||whether to use italics for single-letter symbol names |
It is conventional in traditional mathematical notation that names consisting of single ordinary English letters are normally shown in italics, while other names are not. If you use TraditionalForm, then Mathematica will by default follow this convention. You can explicitly specify whether you want the convention followed by setting the SingleLetterItalics option for particular cells or cell styles.