# Setting a question font / style that will apply to text and inline math environment?

I have defined two commands for the font/style of questions and key concepts in my notes as follows:

``````\newcommand{\key}[1]{{\bfseries\sffamily#1}}
\newcommand{\qtxt}[1]{\textbf{#1}}
``````

Where the commands can be altered at any time to change the appearance of these parts throughout the document (in case anyone is wondering why I wouldn't simply use `\textbf{}` itself).

However, whenever math symbols are included in either of these, I have to wrap them in `\boldsymbol{ }` (or equivalent) to get the desired (consistent) effect. Is there any way that I can define the above commands so that they will apply one rule to text and another rule to anything in `\$ \$` environment?

• there's a `\boldmath` command (switch) in the latex core. i'm not sure whether it copes with absolutely everything, but it's probably worth a try. – barbara beeton Dec 11 '15 at 16:33

``````\newcommand{\qtxt}[1]{\textbf{\boldmath#1}}
• @RaxAdaam `\boldmath` should be mentioned in any latex tutorial, it is a declaration that says any math in its scope should be set using the bold mathversion. It doesn't, itself, start math mode. – David Carlisle Dec 11 '15 at 16:52