About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Smile for the Camera: a new cybercrime short story ebook.


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.


Table 4.1: Special Characters
 
{ } % & $ # _ ^ ~ \


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 em dash upside down exclamation
mark and upside down question
mark . (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\slashor”) will allow a line break at that point.


Table 4.2: Symbols
\textbackslash \ \_ or \textunderscore _
- - -- or \textendash en dash character
--- or \textemdash em dash character \P
\textasciicircum ^ \$ $
\S § \textasciitilde ~
\{ { \ldots ...
\pounds £ \} }
\dag dagger symbol ?` or \textquestiondown upside-down question mark
\textregistered registered symbol \# #
\ddag double dagger symbol !` or \textexclamdown upside-down exclamation mark
\texttrademark TM \% %
' or \textquoteright closing single quote '' or \textquotedblright closing double quote
\copyright © \& &
` or \textquoteleft opening single quote `` or \textquotedblleft opening double quote
\textbullet bullet point \i dotless i
\j dotless 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\oeuvre
as LaTeX will interpret it as the command \oeuvre which doesn't exist.

There are several ways to code this in LaTeX:

  1. Place a space after the command:

    man\oeuvre

  2. Place an empty brace after the command:

    man\oe{}uvre

  3. Group the command:

    man{\oe}uvre

    (This can adversely affect the kerning so is best avoided.)


Table 4.3: Ligatures and Special Symbols (Computer Modern Font)
\AE upper case AE ligature  \ae lower case ae ligature  \OE upper case OE ligature  \oe lower case oe ligature
fi fi ligature  ffi ffi ligature  fl fl ligature  ffl ffl ligature
\AA upper case A ring  \aa lower case a ring  \L upper case L with a stroke  \l lower case l with a stroke
\O upper case slashed O  \o lower case slashed o  \SS upper case Eszett  \ss lower case eszett

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:

It's na\"ive to think that eating mouldy p\^at\'e won't result in food poisoning.

Result:

Image showing typeset output (click here for a more detailed description).


Table 4.4: Accent Commands
  Example    Example
Definition Input Output  Definition Input Output
\'{<object>} \'{c} c with an acute accent  \={<object>} \={c} c with a macron accent
\`{<object>} \`{c} c with a grave accent  \.{<object>} \.{c} c with a dot over it
\^{<object>} \^{c} c with a circumflex  \~{<object>} \~{c} c with a tilde above
\"{<object>} \"{c} c with an umlaut  \v{<object>} \v{c} c with a caron accent
\u{<object>} \u{c} c with a breve accent over it  \H{<object>} \H{c} c with double acute accent
\t{<object>} \t{xy} x and y with a tie over them  \c{<object>} \c{c} c with a cedilla
\d{<object>} \d{c} c with a dot under it  \b{<object>} \b{c} c with a bar under it
\r{<object>} \r{c} c with a ring above       
            

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).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs