[Tex/LaTex] \newcommand vs \DeclareRobustCommand

documentclass-writingmacrospackage-writing

I sort of understand the difference between the two. But that's not what I'm interested in—I just want to know, which one should I use? In general, when I'm creating commands in a package or class, which one should I use all the time?

Best Answer

In my opinion, it is better to use \newcommand if there are no obvious expansion issues. There are two drawbacks of \DeclareRobustCommand:

  1. \DeclareRobustCommand does not check if the macro is predefined.

  2. Macros defined by \DeclareRobustCommand are less efficient.