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?
[Tex/LaTex] \newcommand vs \DeclareRobustCommand
documentclass-writingmacrospackage-writing
Best Answer
In my opinion, it is better to use
\newcommand
if there are no obvious expansion issues. There are two drawbacks of\DeclareRobustCommand
:\DeclareRobustCommand
does not check if the macro is predefined.Macros defined by
\DeclareRobustCommand
are less efficient.