4.3 Special Characters and Symbols
You can use most of the standard characters that you find on your keyboard, but the 10 symbols shown in Table 4.1 have a special meaning.
We have already used the curly braces { and
}. The percent symbol % is a
comment character. Everything from the percent symbol up to the end
of line is ignored by LaTeX. This means you can have comments in
your source code to remind you what a particular part of your code
is doing. We have also used the backslash symbol
\ which indicates that we are using a LaTeX command, as in \LaTeX
or \today
. The meaning of
the other special characters will be covered later.
So what do you do if you want one of these symbols to actually appear
in your document? [Where can I find the symbol for
...?] Table 4.2 lists commands that produce
these and other symbols[How to get copyright, trademark,
etc]. Note that some of the commands have short cuts, such
as --- instead of \textemdash
and
?` instead of \textquestiondown
.
The symbol ` is the backtick (or grave) symbol, as opposed to the apostrophe symbol '. On most UK keyboards it is situated to the left of the 1 key. The opening double quote is created using two adjacent backtick symbols and the closing double quote with two adjacent apostrophe symbols. This gives 66 and 99 style quotes, which you wouldn't get using the double quote symbol on your keyboard.
Note that the symbols | < and > have to
be created using \textbar
, \textless
and
\textgreater
when in normal text mode. If you try to enter
them using the corresponding keyboard characters you may get
and
. (They do however work if you are in
maths mode.4.1) The
slash character / may be used directly, as in
“and/or”, but no line break will be permitted at the slash,
whereas \slash
(as in “and\slash
␣or”) will allow a
line break at that point.
\textbackslash |
\ | \_
or \textunderscore |
_ |
- | - | --
or \textendash |
|
---
or \textemdash |
\P |
¶ | |
\textasciicircum |
^ | \$ | $ |
\S |
§ | \textasciitilde |
~ |
\{ | { | \ldots |
... |
\pounds |
£ | \} | } |
\dag |
?`
or \textquestiondown |
||
\textregistered |
\# | # | |
\ddag |
!`
or \textexclamdown |
||
\texttrademark |
TM | \% | % |
'
or \textquoteright |
''
or \textquotedblright |
||
\copyright |
© | \& | & |
`
or \textquoteleft |
``
or \textquotedblleft |
||
\textbullet |
\i |
||
\j |
\textbar |
| | |
\textperiodcentered |
· | \textless |
< |
\textgreater |
> | \slash |
/ |
Ligatures and special symbols are shown in Table 4.3. (Note that, as mentioned in the introduction, the f-ligatures are automatically converted.) When using a command in the middle of a word, take care that the command doesn't run into the rest of the word. For example, the British spelling of the word manœuvre has an oe-ligature in the middle of it. You will get an error if you try:
man
\oe
uvre
\oeuvre
which doesn't exist.
There are several ways to code this in LaTeX:
- Place a space after the command:
- Place an empty brace after the command:
- Group the command:
(This can adversely affect the kerning so is best avoided.)
\AE |
\ae |
\OE |
\oe |
|||||||
fi | ffi | fl | ffl | |||||||
\AA |
\aa |
\L |
\l |
|||||||
\O |
\o |
\SS |
\ss |
English speakers are by and large very lackadaisical when it comes to accents, but accents affect pronunciation, and so are just as important as the correct spelling. There is a big difference between putting your knife into someone's pâté (meat paste), and putting your knife into someone's pate (head)!
Accented letters are created by specifying which accent you want, and the letter on which to put the accent. The accent commands are listed in Table 4.4, and each command takes one mandatory argument. The command indicates what accent to use, and the argument indicates the letter on which to put the accent.
You may have noticed in Table 4.2 the commands \i
and \j
which produce a dotless i and j (ı and ȷ).
With old versions of LaTeX (or TeX) an accent over a normal
“i” or “j” left the original dot in, which is incorrect, so a
dotless “ı” or “ȷ” were required. With modern
distributions, an accented “i” or “j” is correctly rendered.
Example:
Result:
Example | Example | |||||
Definition | Input | Output | Definition | Input | Output | |
\'{<object>} | \'{c} |
\={<object>} | \={c} |
|||
\`{<object>} | \`{c} |
\.{<object>} | \.{c} |
|||
\^{<object>} | \^{c} |
\~{<object>} | \~{c} |
|||
\"{<object>} | \"{c} |
\v {<object>} |
\v{c} |
|||
\u {<object>} |
\u{c} |
\H {<object>} |
\H{c} |
|||
\t {<object>} |
\t{xy} |
\c {<object>} |
\c{c} |
|||
\d {<object>} |
\d{c} |
\b {<object>} |
\b{c} |
|||
\r {<object>} |
\r{c} |
|||||
This book only covers a very small subset of available symbol commands. If the command you want isn't here, try Scott Pakin's comprehensive symbol list [10]. Another useful resource is detexify.
Footnotes
- ...ch:maths.4.1
- There are also some text fonts that will display them correctly, but don't rely on it.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).