My question is relatively simple, but after reading the new siunitx
documentation, I still don't have the answer.
How to make, in math mode, that the unit is sensitive to the commands \mathbf
and \symbf
and thus have units written in bold ?
For numbers, it works well, so I don't understand why it is not the case with units.
\documentclass{article}
\usepackage{fontspec, unicode-math, siunitx}
\sisetup{
mode=match,
reset-text-family = false ,
reset-text-series = false ,
reset-text-shape = false,
text-family-to-math = false ,
text-series-to-math = false,
propagate-math-font = true,
reset-math-version = false
}
\begin{document}
\noindent
xxxx $\mathbf{2 x = \qty{10}{\kilo\gram}}$ xxxx\\
xxxx $\symbf{2 x = \qty{10}{\kilo\gram}}$ xxxx.\\
\noindent
What I would like to have:\\
xxxx $\symbf{2 x = 10\, kg}$ xxxx.\\
\end{document}
Best Answer
I have logged the initial issue as https://github.com/josephwright/siunitx/issues/525. The reason this arises here is that the 'referenece' output here is
10\,\mathrm{kg}
, and so we end up with\mathbf{10\,\mathrm{kg}}
and get inconsistent bold.The intention for
propagate-math-font
is that it covers font family, rather than other aspects: I should make this clearer. I will think about how best to address the issue, as there are arguments both ways here.What I would say is that making math mode text bold is a job for
\boldmath
. I'd therefore expect to usehere, perhaps with
\mathbf
around thex
depending on the semantics. (\boldmath
is essentially about appearance,\mathbf
is suggesting that there is mathematical meaning to the choice of font.)All that said, I've decided that I will extend the code here to cover
\mathbf
. Until that hits CTAN, you can use