![siunitx:如何在表格中加粗、對齊和分隔?](https://rvso.com/image/330750/siunitx%EF%BC%9A%E5%A6%82%E4%BD%95%E5%9C%A8%E8%A1%A8%E6%A0%BC%E4%B8%AD%E5%8A%A0%E7%B2%97%E3%80%81%E5%B0%8D%E9%BD%8A%E5%92%8C%E5%88%86%E9%9A%94%EF%BC%9F%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 設為粗體並對齊,但我想將第二列或第三列的一些單元格設為粗體並對齊。\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}