5

Upgrading my MikTeX installation (a few days ago) updated my siunitx package to version v2.8 (2020/02/20). Today, I observe that @the egreg's answer now yields different result from what it already did.

The following MWE

\documentclass[11pt]{standalone}
\usepackage{siunitx}
    \sisetup{detect-weight,
             table-format=2.2}
\usepackage{etoolbox}
\renewrobustcmd{\bfseries}{\fontseries{b}\selectfont}
\newcommand{\B}{\bfseries}    % <-- schortcut

\begin{document}
\begin{tabular}{ |S[mode=text] | S |} 
    12.34   &   12.34   \\
\B  12.34   &\B 12.34   \\
\end{tabular}
\end{document}

should return different alignments of numbers in the first and the second columns, yet they are the same. In the first one, the width of the boldface number's digits should be the same of that of the roman number above it. The second column scenario is also depicted below.

enter image description here

Am I missing something?

Zarko
  • 296,517

1 Answers1

9

The handling of \bfseries has changed in the new latex. If you want to switch to b instead of bx you can do it like this:

\documentclass[11pt]{standalone}
\usepackage{siunitx}
    \sisetup{detect-weight,
             table-format=2.2}
\usepackage{etoolbox}

\DeclareFontSeriesDefault[rm]{bf}{b}
\newcommand\B{\bfseries}

\begin{document}
abc \textbf{ab}
\begin{tabular}{ |S[mode=text] | S |}
    12.34   &   12.34   \\
\B  12.34   &\B 12.34   \\
\end{tabular}
\end{document}

enter image description here

Be aware that this also affect the bold font outside the tabular. If this is not wanted you should integrate the switch into the \B command, which then should be made robust

Ulrike Fischer
  • 327,261
  • Thank you very much! This changes in LaTeX make may mine answer obsolete, better to say, in them I need rewrite command for B into \newrobustcmd\B{\DeclareFontSeriesDefault[rm]{bf}{b}\bfseries} (since I like to have this change only in tables with S columns types with bold faces numbers). – Zarko Feb 28 '20 at 21:43