[Tex/LaTex] How to redefine \emph to have bold text with bold math

emphasisformatting

This question explains how to redefine the \emph command so that the text is bold. When mathematical text is included with emphasized text, I have been using the following solution:

\documentclass{report}
\usepackage{bm}

\DeclareTextFontCommand{\emph}{\bfseries}

\begin{document}

\noindent Here the mathematical text is not bold: \\

\noindent An \emph{$n$-dimensional chart} of a topological space $M$ is a pair
$(U,\mathbf{x})$,  where $U$ is an open subset of $M$ and $\mathbf{x}: M \supset U 
\to \mathbf{x}(U)\subset \mathbf{R}^n$ is a homeomorphism. \\

\noindent Here is the corrected version: \\

\noindent An \emph{$\bm{n}$-dimensional chart} of a topological space $M$ is a pair 
$(U,\mathbf{x})$, where $U$ is an open subset of $M$ and $\mathbf{x}: M \supset U \to 
\mathbf{x}(U)\subset \mathbf{R}^n$ is a homeomorphism. 

\end{document}

Output of MWE

My question is: how can you further redefine \emph so that mathematical text is automatically bold, using \bm?

Best Answer

Just add \boldmath:

\documentclass{report}

\DeclareTextFontCommand{\emph}{\boldmath\bfseries}

\begin{document}

Here the mathematical text is bold:

An \emph{$n$-dimensional chart} of a topological space $M$ is a pair $(U,\mathbf{x})$,
where $U$ is an open subset of $M$ and $\mathbf{x}: M \supset U \to \mathbf{x}(U)\subset
\mathbf{R}^n$ is a homeomorphism.

\end{document}

enter image description here

Now that you know how, please, refrain from using boldface for emphasis, particularly if you use mathematics in it.

You seem to have a habit of using \\ at the end of paragraphs: avoid it.