[Tex/LaTex] Using `\textbf{}` to make also math bold in sentence

boldmath-mode

Consider the following MWE:

\documentclass{amsart}

\begin{document}
Let $(M,d)$ be a metric space. For any $x \in M$ and $r > 0$, the \textbf{open ball of radius $r$ around $x$} is the set 

\begin{equation}
    B_r(x) := \{y \in M : d(y,x) < r\}.
\end{equation}
\end{document}

Is there any possibility that the math symbols are also bold by default, i.e. without writing explicitly something like \mathbf{a + b}?

Best Answer

You might update the definition of \bfseries to also issue \boldmath. However I recommend using \emph for emphasis.

Never leave a blank line before an equation or other math display environment. Use ties, as I show in the second example.

\documentclass{amsart}

\makeatletter
\DeclareRobustCommand\bfseries{%
  \not@math@alphabet\bfseries\mathbf
  \fontseries\bfdefault\selectfont
  \boldmath % <-- added
}
\makeatother

\begin{document}

\section{Bad typesetting}

Let $(M,d)$ be a metric space. For any $x \in M$ and $r > 0$, the 
\textbf{open ball of radius $r$ around $x$} is the set 
\begin{equation}
    B_r(x) := \{y \in M : d(y,x) < r\}.
\end{equation}

\section{Good typesetting}

Let $(M,d)$ be a metric space. For any $x \in M$ and $r > 0$, the 
\emph{open ball of radius~$r$ around~$x$} is the set 
\begin{equation}
    B_r(x) := \{y \in M : d(y,x) < r\}.
\end{equation}

\end{document}

enter image description here

Why is it bad using boldface type? Because it's too heavy. Why is it worse to embolden math? Because math symbols have a meaning that also depends on their typographic nature: to a mathematician, a boldface italic ‘r’ is not the same as a medium italic ‘r’.