next up previous contents
Next: Pretty Pictures Up: Inessential LaTeX (Revision: Previous: Foreign Symbols

Mathematical Text and other Special Symbols

 

Equations can be inserted into your text in several ways. Placing $...$ or \(...\) or \begin{math} ...\end{math} around the mathematical expression or special symbol allows you to place it in a line of normal text. This will use the smaller symbols (see Figure gif), and adjust the size of the formula as necessary. It will also adjust other things. For example, to place in a line of text, LaTeX puts the ``i=1'' to the right of the instead of underneath. Placing \[...\] or \begin{displaymath}... \end{displaymath} around the expression will center it and set it off from the rest of the text, using the larger symbols.

  
Figure: Mathematical Symbols

To create a simple equation, for example F=ma , you need only type $ F=ma $. For more advanced formulæ, like , you need to tell LaTeX to superscript the 2. The ^ character instructs LaTeX to superscript, and the _ character instructs LaTeX to subscript.

For example, $ E=mc^2 $ is used to produce . Likewise $ x_{k+1} $ is used to produce .

If you want to put more than one character in the superscript or subscript, you need to group them, using { and } as in the examples above. To print something with both superscripts and subscripts, like , just type $ _{238}U^{+4} $.gif Anything can go into the brackets, and LaTeX will figure out what to do with it: requires the hideous expression $x^{35+9^{y_{z}}+4_{z}}_{1997}$, but if you look carefully it should be clear what is happening. To get the prime (') symbol in math mode, type an apostrophe ('). Try some complex expressions of your own, and see how easy they are to create. There are many symbols not found on the keyboard to help you in formatting just about any kind of formula. See Figures gif, gif, gif and gif for symbols not found on the keyboard, like , , and .

  
Figure: Binary Operations

  
Figure: Relations

  
Figure: Arrows

  
Figure: Miscellaneous Symbols

Of course, not all expressions are polynomials. LaTeX uses two special cases, \sqrt and \frac to create square roots (radical sign surrounding the entire expression) and fractions (one expression over another with a dividing bar between them) respectively. The term , commonly used in Lorentz transformations, is expressed as $ \sqrt{1-\frac{v^2}{c^2}} $ in line. To display it, you might want to use

instead, generated with \[ \sqrt{1-\frac{v^2}{c^2}} \].

If the equation is more interesting, or if you want to refer to it later on, you might want to assign it a number by using the equation environment. The quadratic formula

is displayed by

\begin{equation}
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
\end{equation}
You can supply an optional argument to \sqrt, specifying a different root than 2. For example, the fourth root, , is expressed as \sqrt[4]{1024}.

Often in a mathematical equation you will want to use symbols instead of the standard italicized letters for variable names. You can add Greek letters by typing the command associated with the particular letter--see Figures gif and gif.

  
Figure: Lowercase Greek

  
Figure: Uppercase Greek

Note that if you want to use Greek letters in normal text mode, you must place them in a math environment by surrounding them with $...$. You can also create function names with the font. This is treated like any type style change such as \bf, but like the Greek letters, you can use it only in math mode. In addition, you only have the 26 upper-case letters available (see Figure gif).

  
Figure: Calligraphic Symbols

Sometimes, a formula contains text that should be set in roman type. For example, in the formula ``,'' the word ``log'' is not italicized like the variables x and y. It would be inconvenient to have to exit math mode to type the text in normal roman type, so the most common function names are defined as special commands. A formula such as would be entered as $\cos^2 x + \sin^2 x = 1$. See Figure gif for a list of all the special commands which are typeset like this.

The modulo function is slightly different from the other special commands--it has two forms, a binary and a parenthesized one. See Figure gif for an example of their usage. There are also various types of brackets and other delimiters available in math mode, as shown in figure gif. Certain accents and other diacritical marks are available in math mode. Some of these math mode accents are only available in math mode, while others are modified to work better in math mode. See Figure gif for examples.

  
Figure: Log-like symbols

  
Figure: Modulus functions

  
Figure: Delimiters

  
Figure: Math-mode accents


next up previous contents
Next: Pretty Pictures Up: Inessential LaTeX (Revision: Previous: Foreign Symbols

sepherke
Sat Mar 21 21:20:00 EST 1998