I seem to misunderstand the documentation, as
\newcommand\ph{\textcolor{red}{XXX}}
causes pdflatex to halt. I'm not sure if this is the error:
! Argument of \sf@@subfloat has an extra }.
And I also don't know what it is referring to.
What I want to achieve is that
\myshortcommand
turns into
\textcolor{red}{XXX}
so the output is
XXX (in red)
\protect– Herbert Jan 14 '11 at 20:45\newcommanddefinition doesn't cause the problem.\sf@@subfloatis defined by thesubfigpackage. So I guess, the problem is caused by a fragile command within a subfigure caption. You might look for that. – Stefan Kottwitz♦ Jan 14 '11 at 20:51