![siunitx: テーブル内で太字、整列、区切りを設定するにはどうすればいいですか?](https://rvso.com/image/330750/siunitx%3A%20%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E5%86%85%E3%81%A7%E5%A4%AA%E5%AD%97%E3%80%81%E6%95%B4%E5%88%97%E3%80%81%E5%8C%BA%E5%88%87%E3%82%8A%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%81%84%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F%20.png)
次の siunitxtable があります:
\sisetup{separate-uncertainty=true}
\begin{tabular}{
l
S[table-format=6.0, table-figures-uncertainty=5]
S[table-format=6.0, table-figures-uncertainty=5, detect-weight]
S[table-format=2.0]
S[table-format=1.2, detect-weight]
}
\toprule
{algorithm} & {$1$-ply} & {$3$-ply} & {\# $n$-tuples} & {time [days]}\\
\midrule
42-33 (baseline) & 265435\pm8511 & 393289\pm26496 & 5 & 2.35 \\
42-33, CS & 258616\pm5784 & 432701\pm13005 & 5 & 2.78 \\
42-33-4-22, CS & 263156\pm27722 & 464836\pm15941 & 10 & \bfseries 4.63 \\
42-33-4-22-3 & 319433\pm2708 & 469779\pm10920 & 12 & 5.06 \\
42-33-4-22-3, CS & 314013\pm7587 & 491398\pm19458 & 12 & 5.47 \\
\bottomrule
\end{tabular}
4.63 を太字にして整列させることができましたが、2 列目または 3 列目の一部のセルも太字にして整列させたいと思います。\bfseries
うまくいきません。どうすればいいでしょうか?
答え1
説明されているようにコマンドを\robustify
実行する必要があります\bfseries
ここそうすれば、どのS
列でも機能します。
\documentclass[border=2mm]{standalone}
\usepackage{etoolbox}
\usepackage{booktabs}
\usepackage{siunitx}
\sisetup{separate-uncertainty=true}
\begin{document}
\robustify\bfseries
\begin{tabular}{
l
S[table-format=6.0,table-figures-uncertainty=5]
S[table-format=6.0,table-figures-uncertainty=5, detect-weight]
S[table-format=2.0]
S[table-format=1.2,detect-weight]
}
\toprule
{algorithm} & {$1$-ply} & {$3$-ply} & {\# $n$-tuples} & {time [days]}\\
\midrule
42-33 (baseline) & 265435(8511) & 393289(26496) & 5 & 2.35 \\
42-33, CS & 258616(5784) & \bfseries 432701(13005) & 5 & 2.78 \\
42-33-4-22, CS & 263156(27722) & 464836(15941) & 10 & \bfseries 4.63 \\
42-33-4-22-3 & 319433(2708) & 469779(10920) & 12 & 5.06 \\
42-33-4-22-3, CS & 314013(7587) & 491398(19458) & 12 & 5.47 \\
\bottomrule
\end{tabular}
\end{document}