Wouldn't be better to define one command
\newcommand\bm[1]{\ensuremath{${\boldmath$#1$}}$}
and it can be used both in text
mode and math
mode.
Usage:
\[\bm{F(x)}=\int\bm\delta(x)\ dx]
\where \mb F is blah blah blah and \bm \delta is halb halb halb...
Result:
F(x)='inegral delta(x)'dx
Where F is blah blah blah and 'delta' is halb halb halb...
Outer dollars are there to leave math (roman) mode because \boldmath
command has no effect in math mode. Inner ones switch back to math (bold). Additional braces (${\boldmath
) ensures that \boldmath
command will work only with #1
Another advantage of this code is testing new commands for existence of \bb
and \bg
. So you can't crash LaTeX makros easily.
I hope this is what you're looking for.