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?


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}}
  • 32
    "[A fragile command is a command that] expands into illegal TeX code during the save process." - What does this mean? What is the "save" process? How does a command that expands into illegal TeX successfully compile? Are there circumstances wherein a so-called "fragile command" expands into legal TeX? – Jake Aug 5 '16 at 6:17
  • 5
    I'm with @Jake here. While the answer technically answers the question, it leaves open a lot of questions. However this question is a duplicate anyway and the answer on the other question as linked on top is far more detailed. – Sunday Dec 7 '17 at 10:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.