I want to create a macro say BOLDMATH such that whenever I use this macro it should do following:
if in equation environment or inline math mode then it should return \mathbf{.} else it should return $\mathbf{.}$
I can use 2 macros but I want a compact one.
\newcommand\BOLDMATH[1]{\ensuremath{\mathbf{#1}}}
– Steven B. Segletes May 19 '20 at 0:57\ifmmode ... \else ... \fi
and LaTeX2e command\TextOfMath{<text mode>}{<math mode>}
, – muzimuzhi Z May 19 '20 at 1:23