How to boldify math equation and plain text simultaneously
Yo can apply \boldmath
:
Surrounding it with {...}
limits the scope to be just within the curly braces so subsequent text is not effected.
Notes:
- As per egreg's suggestion I have replaced
$s=9, s*s$
with$s=9$, $s*s$
. The,
is not really part of the math, thus, it should be outside. This yields better spacing.
Code:
\documentclass{article}
\begin{document}
Since $s=9$, $s*s$ becomes 81
{\bfseries\boldmath Since $s=9$, $s*s$ becomes 81}
Since $s=9$, $s*s$ becomes 81
\end{document}
Run with lualatex
or `xelatex
\documentclass{article}
\usepackage{unicode-math}
\setmathfont{xits-math.otf}
\setmathfont[version=bold]{xits-mathbold.otf}
\newcommand\allBold[1]{{\bfseries\mathversion{bold}#1}}
\newcommand\allbold[1]{{\bfseries\boldmath#1}}
\begin{document}
Since $s=9, s*s$ becomes 81 $\displaystyle\int_a^b f(x)\mathrm{d}x$
\allbold{Since $s=9, s*s$ becomes 81 $\displaystyle\int_a^b f(x)\mathrm{d}x$}
\allBold{Since $s=9, s*s$ becomes 81 $\displaystyle\int_a^b f(x)\mathrm{d}x$}
Since $s=9, s*s$ becomes 81 $\displaystyle\int_a^b f(x)\mathrm{d}x$
\end{document}