46
38
Chapter 2 Text
Practical Tip 19. Do not disregard such warnings even if the document is already
correctly typeset. At a later time, such errors can have strange consequences.
2.2.3 Types of commands
It can be useful at this point to note that commands can be of various types.
Some commands have arguments, and some do not. Some commands effect
change only in their arguments, while some commands declare a change. For instance,
\textbf{This is bold} typesets the phrase This is bold in bold type: This is
bold and has no effect on the text following the argument of the command. On the
other hand, the command \bfseries declares that the text that follows should be bold.
This command has no argument. I call a command that declares change a command
declaration. So \bfseries is a command declaration, while \textbf is not. As a
rule, command declarations are commands without arguments.
Commands with argumentsare called long—or commandswith long arguments—
if their argument(s) can contain a blank line or a \par command; otherwise they are
short—or commands with short arguments. For example, \textbf is a short command.
So are all the top matter commands discussed in Section6.6.1.
Fragile commands
As a rule, LAT
E
Xreads a paragraph of the source file, typesets it, and then goes on to the
next paragraph. Some information from the source file, however, is separately stored
for later use.
Examples: the title of a document, which is reused as a running head (Section
6.6.1),tableofcontents(Sections 6.5.4),orfootnote(Section 2.4.2).
These are movable arguments, and certain commands embedded in them must
be protected from damage while being moved. L
A
T
E
Xcommands that need such pro-
tection are called fragile. The inline math delimiter commands \( and \) are fragile,
while $ is not. In a movable argument, fragile commands must be protected with a
\protect command. Thus \( f(x^{2}) \) is not appropriate in the title for a docu-
ment, but
\protect \( f(x^{2}) \protect \)
is. To be on the safe side, you should protect every commandthat might cause problems
in a movable argument. A user-defined command, declared with
\DeclareRobustCommand
is not fragile; it needs no protection. This command is like the \newcommand (see
Section7.1) but defines a robust command.
2.3 Symbols not on the keyboard
Atypeset document can contain symbols that cannot be typed. Some of these symbols
can even be available on the keyboard but you are prohibited from using them. In this
section, we discuss the commands that typeset some of these symbols in text.