I have written a long document with a lot of equations that contain both \bm and \mathbf. However, now I would like to switch their behaviour. So whenever I have \mathbf{X} in the document, I would like to compile \bm{X} behaviour and vice versa. Is there a way to achieve this without manually modifying each occurence?
Edit: Things I have tried:
\let\temp\mathbf
\let\mathbf\bm
\let\bm\temp
and
\newcommand{\tmpbf}[1]{\mathbf{#1}}
\renewcommand{\mathbf}[1]{\bm{#1}}
\renewcommand{\bm}[1]{\tmpbf{#1}}
both of which did not seem to work and freeze the pdflatex compilation.
\bm{->\waitbm{,\mathbf{->\bm{,\waitbm{->\mathbf{switcheroo. That keeps your commands as expected and drastically decreases the potential for confusion (for other readers and future you). – moewe May 31 '20 at 13:05\letapproach should actually appear to sort of work in many normal circumstances, but does not work properly, because the commands are actually implemented via protected helper commands internally (see an example of how badly things can go wrong at https://gist.github.com/moewew/c58ef0165e758887dc6dc2c0be88d23a). You'd have to use https://tex.stackexchange.com/q/88001/35864. But really it seems much, much safer, easier and less confusing to let your editor to a bit of search and replace. – moewe May 31 '20 at 13:11\bmand\mathbfhave quite different syntax and allowed arguments, and swapping them at all only works if your document restricts the uses of\bmto cases where\mathrmwill not error. – David Carlisle May 31 '20 at 15:38