Using `\textbf{}` to make also math bold in sentence

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’.


Update \textbf to also execute \boldmath:

enter image description here

\documentclass{amsart}

\usepackage{mathtools}

\let\oldtextbf\textbf
\renewcommand{\textbf}[1]{\oldtextbf{\boldmath #1}}

\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) \vcentcolon= \{y \in M \mid d(y,x) < r\}.
\end{equation}

\end{document}

For some this may change the notation, since there could be a different interpretation of r and r, for example.


A wiser choice for the redefinition of \textbf:

\usepackage{letltxmacro}
\LetLtxMacro\oldtextbf\textbf% http://tex.stackexchange.com/q/88001/5764
\DeclareRobustCommand{\textbf}[1]{\oldtextbf{\boldmath #1}}

Tags:

Bold

Math Mode