What is the primary reason to \protect new definitions or macros, or use \DeclareRobustCommand rather than just \def?
(If it is primarily to do with better error messages, I personally can live with the Prolog ``No''. If it's better to start using it everywhere, which are the packages to load and best practices?)
WANTED: A one sentence answer I can give other people about why \DeclareRobustCommand is used somewhere but elsewhere there is \def.
MOTIVATION: Sometimes you base code on an existing macro and put in an article. \DeclareRobustCommand is sometimes used. Then a coauthor or an editor replies: Why do you need this complicated looking code? What do you tell them?
\DeclareRobustCommandis defined in the latex format, not in a package. It's not the difference between good and bad error messages, but rather the difference between things working and getting an error message. But I think it's probably a duplicate of the questions Werner lists – David Carlisle Mar 05 '16 at 09:17\protectin front of the command in all moving arguments such as headings captions, writing to files etc, so the command is more complicated for the user. – David Carlisle Mar 05 '16 at 09:22\def, asking to use\newcommandor similar method; this includes\DeclareRobustCommand, but only if preceded by a\newcommandfor checking definability of the command (unless comments explain why the author wants to redefine a command). – egreg Mar 05 '16 at 14:28\newcommand, asking to use\defor similar method. Because\newcommanddoesn't work in plain TeX. – wipet Mar 05 '16 at 15:16etoolboxyou can apply\robustify\mycommandand it will be robust after that. – Mar 06 '16 at 07:46