0

I’ve been using \let\oldsomething\something\renewcommand*something{\oldsomething ...} in a couple places, but it’s tedious and I guess prone to errors if I were to try to redefine again with the same auxiliary macro.

After learning about \g@addto@macro I was happy for a while. Then arose the need to append to a command which has arguments:

\newcommand*{\hello}[1]{Hello #1}
\g@addto@macro{\hello}{!}
\show\hello

That sequence prints:

> \hello=macro:
Hello !.

So, the argument seems to disappear. The result I was attempting is:

> \hello=macro:
->Hello #1!.

Is there some easy way to change the middle line to obtain this, or is it back to the old way for macros with arguments?

timo_k
  • 15

0 Answers0