[texhax] Using special characters like _ and " etc
uwe.lueck at web.de
Mon Dec 29 15:45:32 CET 2008
At 12:57 29.12.08, Syed Faraz Hasan wrote:
>Latex displays everything following an underscore _ or an inverted comma "
>in italics form. There seems to be a special way of using special
>characters in the text.
`_' is a standard TeX matter. I experience here and myself that there are
installations nowadays that don't stop at errors, so many users don't
realize them! In your .log file, you will find `missing $ inserted'; in the
old times, TeX stopped to tell you this on screen. `_' is only allowed in
math mode, not in ordinary text. To get an underscore symbol, type `\_'.
`_' in text doesn't really switch to italics, rather TeX treats it as `$_'
and considers all following text a mathematical formula, until it finds a
`$' or a \par. You also should have noticed that the first character after
`_' appears as a subscript, that's what `_' is for.
The TeXbook lists all these special characters on page 36. Perhaps looking
for `category code' helps to find explanations of all of them in various
documents on TeX and LaTeX.
I am astonished that `"' should switch to something like italics. babel.sty
and german.sty use it for generating certain language-specific letters or
characters. Using it for quoting is ``deprecated'' in TeX which was made
for high typographic ambitions.
More information about the texhax