Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Chapter 1: Writing documents

Section 1.7: Special characters

There are ten keyboard characters which have special meanings to LATEX, and cannot be used on their own except for the purposes shown in Table 1.2 below.

Table 1.2: Special characters in LATEX

KeySpecial meaningIf you need

the actual character

itself, type it like this:
Example
\The command character\textbackslash (\)
$Old TEX math delimiter\$\$37.46
%The comment character\%42%
^Math superscript character\^\^{}
&Tabular column separator\&AT\&T
_Math subscript character\_A\_B
~Non-breaking space\~\~{}
#Macro parameter symbol\##42
{Argument start delimiter\{$\{$
}Argument end delimiter\}$\}$

The LATEX mathematics delimiters are \[\] for display math and \(\) for inline math. The use of the dollar and double-dollar is deprecated: see the tip ‘Delimiters’ below

These characters were deliberately chosen, either because they are rare in normal text, or (in the case of $, #, &, and %) they already had an established special meaning on computers as metacharacters (characters standing as symbols for something else) when TEX was written.

We saw at the start of this section how to use the backslash to begin a command, and how to use curly braces to delimit an argument, and we are not covering the mathematical uses in this book. The only special characters remaining from the list in Table 1.2 above are therefore:

%

The comment character makes LATEX ignore the remainder of the line in your document, so you can see it in your editor, but it will never get typeset. For example:

Today's price per kilo is €22.70 
% get Mike to update this daily

As with all comments in documents, don’t forget to remove them before sending the original document source to someone else!

and must never be allowed authority to create 
a charge on the department again. 
% and fire those idiots down in Finance!
~

The tilde in LATEX prints as a normal space, but prevents a linebreak ever occurring at that point. It’s often used between a person’s initials and their surname, such as P.~Flynn, in case it might fall at the end of a line where a linebreak would make it harder to read.

&

The ampersand is used in tabular setting (rows and columns) to separate the cell values within each row. We’ll see how this works in § 4.2 below.

#

The hash mark or octothorpe is the American ‘pound’ [weight] or ‘number’ sign.

For the pound (sterling) currency sign use the \textsterling command if there is no £ on your keyboard.

While we’re on the subject of money, not every font has a Euro character (€), especially those designed before the currency came into being. The default € sign in many fonts is a crummy design based on the letter C instead of a rounded E. The official (sans-serif) Euro sign is in the marvosym package and is done with the \EUR command. A slightly unusual but more interesting serif Euro sign is in the textcomp package using the \texteuro command with the the TS1 font encoding (see § 6.2.3 below for details of switching typefaces and settings in mid-text).

Ordinal superscripts

Don’t use them in normal English text. Superscripted ordinals like 21st are a historical relic of Victorian and earlier typography. Unless done with skill by a typographer, they are usually ugly and unnecessary, and are almost never used in modern professional typesetting. They were re-introduced by Microsoft Word apparently because some American corporations liked their wordprocessing to look like what they fondly imagine print used to be.

If you want to try to mimic low-grade wordprocessing, or if you are trying to make a genuine typographic facsimile of antiquarian typesetting, use the \textsuperscript command from the textcomp package. Never, never, NEVER use math mode superscripting for text superscripts — it’s the wrong height, wrong size, and the wrong font.

In non-English languages (European ones, at least) the position is completely different: the ordinal feminine and masculine characters like 2ª (‘secunda’) or 8º (‘octavo’) are the normal method of representation, and their use in Latin-derived terminology in printing and binding remains standard.

  1. The £ sign is now nearly obsolete except in the United Kingdom (UK) and some of its former colonial dependencies; in Egypt, Sudan, and Syria; and some other countries for historical purposes. It should not be confused with ₤, used in countries using the Lira.