The following characters play a special role in LaTeX and are called “reserved characters” or “special characters”.
# $ % & ~ _ ^ \ { }
Whenever you write one of these characters into your file, LaTeX
will do something special. If you simply want the character to be
printed as itself, include a \
in front of the character. For
example, \$
will produce $
in your output.
One exception to this rule is \
itself, because \\
has
its own special (context-dependent) meaning. A roman \ is produced by
typing $\backslash$
in your file, and a typewriter \
is
produced by using ‘\’ in a verbatim command (see verbatim).
Also, \~
and \^
place tilde and circumflex accents over
the following letter, as in õ and ô (see Accents); to get
a standalone ~
or ^
, you can again use a verbatim
command.
Finally, you can access any character of the current font once you
know its number by using the \symbol
command. For example, the
visible space character used in the \verb*
command has the code
decimal 32, so it can be typed as \symbol{32}
.
You can also specify octal numbers with '
or hexadecimal numbers
with "
, so the previous example could also be written as
\symbol{'40}
or \symbol{"20}
.