# What is the purpose of \protect? [duplicate]

Possible Duplicate:
What is the difference between Fragile and Robust commands?

I've never understood the purpose of the command \protect? When and why should it be used?

-
Possible duplicate question: tex.stackexchange.com/questions/4736/… –  Leo Liu Mar 5 '11 at 8:28
And refer this FAQ: tug.org/texlive/devsrc/Master/texmf-dist/doc/generic/FAQ-en/… –  Leo Liu Mar 5 '11 at 8:30

## marked as duplicate by Leo Liu, lockstep, Caramdir, Lev Bishop, Andrew StaceyMar 7 '11 at 14:26

To understand how to use \protect you need to understand the concept of fragile commands and to understand this concept, you need to understand what a moving argument is. Some commands called fragile commands causes an error when they use a moving argument. It's a command that expands into illegal TeX code during the save process. Some arguments are called moving arguments because they may be "moved" to other places in the document. A fragile command that appears in a moving argument must be preceded by a \protect command. For example,

• sectioning commands
• arguments of \caption commands
• commands that produce page headings

An example :

\caption{Beautiful picture from \protect \citeauthor{allan}
\protect \shortcite{allan}}

-