bm と siunitx の不一致

bm と siunitx の不一致

このmweで、

\documentclass{article}
\usepackage{bm,siunitx}

% change nothing to the problem
\sisetup{
    detect-weight,
    detect-display-math
}

\begin{document}
$\bm{\num{.1}}$
\end{document}

このエラーメッセージが表示されます

> ! Undefined control sequence.
> <argument> \LaTeX3 error: 
                A sequence was misused.
l.11 $0<\bm{\num{.1}}
                   $

この他の mwe では:

\documentclass{article}
\usepackage{siunitx,bm}

\sisetup{
    detect-weight,
    detect-display-math,
    detect-inline-weight=math
}

\begin{document}
$\num{5}x\bm{5x\num{5}}$
\end{document}

次のエラーメッセージが表示されます:

! Argument of \__tl_tmp:w has an extra }.
<inserted text> 
\par 
l.11 $\num{5}x\bm{5x\num{5}}
                      $

そして\mathbf動作せず、醜い「x」が作成されます。

\documentclass{article}
\usepackage{siunitx,bm}

\sisetup{
    detect-weight,
    detect-display-math,
    detect-inline-weight=math
}

\begin{document}
$\num{5}x\mathbf{5x\num{5}}$

$\bm{0.1}\quad\mathbf{\num{.1}}$
\end{document}

ここに画像の説明を入力してください

答え1

\numおよびコマンドを中括弧で保護できます\SI

\documentclass{article}
\usepackage{bm,siunitx}

\begin{document}


\sisetup{detect-weight = true,detect-inline-weight = math}

$\num{5} \SI{50}{\km}$

$\bm{bob{\num{5}\SI{30}{\km}}}$
\end{document}

ここに画像の説明を入力してください

関連情報