Next: Commands and Environments Up: The Basics of LATEX Previous: The Basics of LATEX

## Special Characters

Certain characters have special meaning in LATEX. Typing these characters doesn't make them appear in the output. For example, the character % is used to add comments to LATEX input files: A % and everything that follows it on the line is ignored by LATEX.

The most important special character is the backslash, `\`. The backslash is used to give special commands to LATEX. For example, the LATEX logo itself is actually produced by the command `\LaTeX`. A command consists of a backslash followed by a sequence of letters. Also, a command can consist of a backslash followed by a single non-letter character. For example, if you want the special character % to appear in the output, you can type it as `\%`. `\%` is a command that tells LATEX to put a % into the output.

Other special characters include \$, #, &, _, {, and }. These can be types at `\\$`, `\#`, `\&`, `\_`, `\{`, and `\}`. The dollar sign is particularly important in LATEX: It is used to enclose mathematics. For example, the mathematical inequality is typed as `\$x<y\$`. This is called math mode. There are three special characters that only come out correctly in math mode: , , and . These characters can be typed between dollar signs. For example: `\$<\$`. The backslash itself can be generated using the command `\backslash` in math mode; that is, `\$\backslash\$` yields  in the output. There are two more special characters, `~` and `^`, that we will get to later.1

Some characters that appear in documents can't be typed at all. An example is the left double quote mark, ``. In LATEX, this symbol is inserted into the output by typing two single left quotes: ````. You can type a right quote as two right single quotes, `''` (although in fact typing the usual double quote character will give the same thing). Similarly, there are actually three types of dashes: the hyphen (-), the n-dash (-) that is used in number ranges such as 2003-2004, and the m-dash (--) that is used to separate text--like this--from the rest of the sentence. In LATEX, you type -, -, and -- as `-`, `--`, and `---`.

There are many more special characters, especially when you consider mathematical symbols. These are entered into LATEX output using special commands. For example, the command `\copyright` gives ©, and `\dag` gives . There are a lot of commands that are valid only in math mode, and we will see some of these later. The command `\dots` gives the three dots that are usually used to represent an ellipsis; you need this because typing three periods gives ... and that doesn't look as good as ...

And finally, there are characters that are accented or otherwise decorated, such as the ö in coöperate. The most common accents are input as single-character commands in front of the letter that is to be accented. Type `\'e`, `\`e`, `\"u`, `\~n`, `\^o`, and `\=a`, for é, è, ü, ñ, ô, and a.

Next: Commands and Environments Up: The Basics of LATEX Previous: The Basics of LATEX
David Eck 2003-10-21