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.6: 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.1.

Table 1.1: Special characters in LATEX

KeySpecial meaningIf you need

the actual character

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

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.

1.6.1 Using the special characters

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.1 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 be typeset towards the end of a line where an intervening 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.

#

The hash mark or octothorpe is the American ‘pound’ [weight] or ‘number’ sign. For a pound (sterling) sign (£, now nearly obsolete except in the UK and some of its former dependencies, and for historical purposes), use the \textsterling command.

While we’re on the subject of money, not every font has a Euro character (€), especially those designed before the currency was invented. The default € sign in many fonts is a crummy design based on the letter C instead of the rounded E. An official (sans-serif) Euro sign is in the marvosym package and is done with the \EUR command (see § 3.1 for details of how to use LATEX packages). However, 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.5 and § 6.2.4 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 and finesse by a typographer, they are usually ugly and unnecessary, and are 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 it used to be.

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

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