I have some simple formulas that I would like to have in bold and non-bold versions. Because retyping a formula is error-prone, I'd like to have a macro that takes the non-bold formula (which is wrapped in a macro) and emits a copy of the macro, but bolded.
What I have so far: (MNWE):
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{etoolbox}
\thispagestyle{empty}
\newcommand{\foo}{A\text{a}\text{b}+}
\newcommand{\baz}{B\text{c}\text{d}-}
\makeatletter
\newcommand{\boldify}[2]{%
\let\@boldme#1
\patchcmd{\@boldme}{\text}{\textbf}{}{}
\newcommand{#2}{\ensuremath{\boldsymbol{\@boldme}}}
}
\makeatother
\boldify{\foo}{\bffoo}
\boldify{\baz}{\bfbaz}
\begin{document}
$$\foo \bffoo$$
$$\baz \bfbaz$$
\end{document}
This produces:

There are three reasons I'm unsatisfied:
- The second
\textis not bolded. - The
\textblocks in the last invocation replace those in the first. - I have to manually specify the name of the bold version of the command.
It's only the 2nd problem which is really critical for me.
What am I missing?


