相关代码如下
\begin{table}
\centering
\begin{tabular}{ll*{4}{S}}
\toprule
STD & Working point [V] & 9680(5) & 9973(26) & 10304(49) \\
October & Maximum efficiency [\%] & 96.6(0.1) & 90.8(0.5) & 85.1(0.9) \\
\bottomrule
\end{tabular}
\end{table}
使用包siunitx
和序言中的选项\sisetup{separate-uncertainty,table-align-uncertainty,table-format = 4.1(2)}
。我想要做的是仅对齐\pm
不确定性并删除小数点分隔符对齐的默认设置。有没有办法用siunitx
包做到这一点?
我见过类似问题,但尚未给出适当的答案。
答案1
\documentclass[12pt]{article}
\usepackage{booktabs}
\usepackage{siunitx}
\sisetup{separate-uncertainty,table-align-uncertainty,table-format = 5.1(2)}
\begin{document}
\begin{table}
\centering
\begin{tabular}{ll*{4}{S}}
\toprule
STD & Working point [V] & 9680(5) & 9973(26) & 10304(49) \\
October & Maximum efficiency [\%] & 96.6(0.1) & 90.8(0.5) & 85.1(0.9) \\
\bottomrule
\end{tabular}
\end{table}
\begin{table}[ht!]
\centering
\begin{tabular}{ll *{3}{r@{\,}c@{\,}l}}
\toprule
STD & Working point [V] & 9680 &$\pm$ &5 & 9973 &$\pm$ & 26& \num{10304} &$\pm$ &49 \\
October & Maximum efficiency [\%] & 96.6 &$\pm$ &0.1& 90.8 &$\pm$ &0.5& 85.1 &$\pm$ &0.9 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
答案2
我不确定通过对齐\pm
指向非同质数据的符号是否能获得更清晰的结果。
我投票支持将条目置于中心位置。
\documentclass[12pt]{article}
\usepackage{booktabs}
\usepackage{siunitx}
\sisetup{
separate-uncertainty,
}
\begin{document}
\begin{table}
\centering
\begin{tabular}{
@{}
l
l
*{3}{S[table-alignment-mode=none]}
@{}
}
\toprule
STD & Working point (V) & 9680(5) & 9973(26) & 10304(49) \\
October & Maximum efficiency (\%) & 96.6(0.1) & 90.8(0.5) & 85.1(0.9) \\
\bottomrule
\end{tabular}
\end{table}
\end{document}