4

At last upgrade my MikTeX installation (a few days ago) was also updated the siunitx package to version v2.8 (2020/02/20). Today I observe that @egreg answer now gives different result as before.

A MWE based on his answer:

\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 gives different align of numbers in the first and second column, however they are the same. In the first the boldface number should has the same width of its digits as has roman number above it, and in the second column as it is shown in the table image below.

enter image description here

Do I miss something?

8

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

|improve this answer|||||
  • 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 at 21:43

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.