5

With this mwe,

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

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

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

I get this error message

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

With this other 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}

I have the next error message :

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

And \mathbf doesn't work and makes uggly "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}

enter image description here

  • Just out of idle curiosity: Why don't you write either \textbf{\num{.1}}? – Mico Feb 20 '18 at 22:26
  • 1
    I follow the advice given to use \bm with success until now. Nevertheless, \mathbf doesn't work as you can see on my edit. – Tarass Feb 20 '18 at 22:37
3

You can protect the \num and \SI commands with braces:

\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}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.