TransWikia.com

Is there a way to bold siunitx entries in a tabular when using the libertine package?

TeX - LaTeX Asked on January 1, 2021

I am using the libertine and libertinust1math packages for my thesis. The 75% entry on the "Bob" row is not becoming bold — as far as I can tell — when I use boldseries on it in the following MWE:

documentclass[oneside,11pt]{book}

usepackage[semibold,tt=false]{libertine}
usepackage{libertinust1math}
usepackage[
  expansion = false ,
  tracking = smallcaps ,
  letterspace = 40 ,
]{microtype}
usepackage{booktabs}
usepackage{siunitx}
sisetup{%
  detect-family, detect-shape, detect-weight,
  product-units = power,
  list-final-separator = {, and },
  retain-explicit-plus,
  input-comparators = {<=>approxgegeqggleleqllsimlesssimgtrsim}
}
DeclareSIUnit[number-unit-product = ]percent{char`%}

begin{document}

begin{table}[!h]
  centering
  begin{tabular}{lSS}
    toprule
    A & {B} & {C}
    midrule
    bfseries Bob & bfseries SI{75}{percent} & bfseries -11.11
    Carla & SI{75}{percent} & 2.22
    Dale & SI{75}{percent} & -3.33
    Ena & SI{75}{percent} & 4.44
    bottomrule
  end{tabular}
  caption{Caption 1}
end{table}

end{document}

mwe1

However, if I comment out the lines usepackage[semibold,tt=false]{libertine} and usepackage{libertinust1math}, the 75% entry on the "Bob" row becomes bold:

mwe2

Why is this, and is there any way that I can get libertine to respond to boldseries?

One Answer

Using my answer on one of your previous question:

documentclass[oneside,11pt]{book}
usepackage[semibold,tt=false]{libertine} % <---
usepackage{libertinust1math}             % <---

usepackage{booktabs}
usepackage{siunitx}

usepackage{etoolbox}
newrobustcmdB{DeclareFontSeriesDefault[rm]{bf}{b}bfseries}
newcommandmcc[1]{multicolumn{1}{c}{#1}}

begin{document}
    begin{table}[!h]
    centering
sisetup{detect-weight,
         table-format=2.0
        }
begin{tabular}{lS[table-space-text-post=,%]<{,%}
                 S[table-format=-2.2]}
    toprule
A       & mcc{B}   & mcc{C}
    midrule
textbf{Bob}    &B 75      &B -11.11
Carla           &   75      &     2.22
Dale            &   75      &    -3.33
Ena             &   75      &     4.44
    bottomrule
  end{tabular}
caption{Caption 3}
label{tab:boldsiunitx}
    end{table}
end{document}

gives :

enter image description here

Correct answer by Zarko on January 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP