Siunitx conflicts with textbf

boldsiunitx

I've recently updated my computer from TeXLive 2019 to TeXLive 2022, and a document that compiled perfectly with the 2019 version raises an error with the new version. The problem occurs when i try to use the \ohm unit (defined in the siunutx package) inside a \textbf command, but the strange thing is that using the \farad unit the problem does not arise.

\documentclass{article}
\usepackage{siunitx}

\begin{document}
$ \si{\textbf{\farad}} = \si{\coulomb \per \volt} $ → no problem

$ \si{\textbf{\ohm}} = \si{\volt \per \ampere} $ → raise an error

$ \si{\ohm} = \si{\volt \per \ampere} $ → no problem
\end{document}

I'm using the $ ... $ because in other parts of the document I have to make some operations with these units, and also because this ensures the correct spacing.

Best Answer

Use \mathbf not \textbf, since \Omega is not "text". An error would likewise occur if you had merely typed $\textbf{\Omega}$, in the absence of siunitx.

\documentclass{article}
\usepackage{siunitx}

\begin{document}
$ \si{\textbf{\farad}} = \si{\coulomb \per \volt} $ → no problem

$ \si{\mathbf{\ohm}} = \si{\volt \per \ampere} $ → raise an error

$ \si{\ohm} = \si{\volt \per \ampere} $ → no problem
\end{document}

enter image description here

Related Question