| 1 |
Encoding special characters |
| 2 |
=========================== |
| 3 |
|
| 4 |
The LaTeX Info pages list under "2.18 Special Characters" |
| 5 |
|
| 6 |
The following characters play a special role in LaTeX and are called |
| 7 |
"special printing characters", or simply "special characters". |
| 8 |
|
| 9 |
# $ % & ~ _ ^ \\ { } |
| 10 |
|
| 11 |
The special chars verbatim:: |
| 12 |
|
| 13 |
# $ % & ~ _ ^ \ { } |
| 14 |
|
| 15 |
However also *square brackets* [] need special care. |
| 16 |
|
| 17 |
Commands with optional arguments (e.g. ``\item``) check |
| 18 |
if the token right after the macro name is an opening bracket. |
| 19 |
In that case the contents between that bracket and the following |
| 20 |
closing bracket on the same grouping level are taken as the |
| 21 |
optional argument. What makes this unintuitive is the fact that |
| 22 |
the square brackets aren't grouping characters themselves, so in |
| 23 |
your last example ``\item[[...]]`` the optional argument consists of |
| 24 |
[... (without the closing bracket). |
| 25 |
|
| 26 |
Compare the items in the following lists: |
| 27 |
|
| 28 |
* simple item |
| 29 |
* [bracketed] item |
| 30 |
|
| 31 |
simple |
| 32 |
description term |
| 33 |
|
| 34 |
[bracketed] |
| 35 |
description term |
| 36 |
|
| 37 |
The OT1 font-encoding differs from ASCII for the less-than, greater-than |
| 38 |
and bar characters (< | >) except for typewriter font `cmtt` |
| 39 |
(``< | >``). |