在以下涉及siunitx
封装,我怎样才能对齐第二列(熔化温度)和第三列(粘度 eta)中的数字?我已尝试S[table-format=-2.2,table-number-alignment=left]
过S[table-format=2.2,table-number-alignment=left]
。
\documentclass[oneside,11pt]{book}
\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage[
expansion = false ,
tracking = smallcaps ,
letterspace = 40 ,
]{microtype}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}
\centering
\begin{tabular}{
l
S[table-format=-2.2,table-number-alignment=left]
S[table-format=2.2,table-number-alignment=left]
l}
\toprule
& {$T_m$ (\si{\celsius})} & {$\eta$ (\si{\milli\pascal})} & $\sigma$ (\si{\siemens/\centi\meter})\\
\midrule
A & \num{14(1)} & \num{38(1)} & \num{13} @ \SI{20}{\celsius}\\
B & \num{-85(2)} & \num{104(4)} & \num{3.6} @ \SI{20}{\celsius}\\
\addlinespace
C & \num{-1.71(7)} & \num{32.2(6)} & \num{8.8} @ \SI{20}{\celsius}\\
D & \num{-2.93(4)} & \num{50.09(90)} & \num{3.9} @ \SI{20}{\celsius}\\
\bottomrule
\end{tabular}
\caption{Caption.}
\end{table}
\end{document}
答案1
作为Skillmon 已经指出,无需在类型列\num
内使用S
。相反,您可以调整选项table-format
以解决不确定性。table-format=-2.2(1)
应该适用于“温度”列。为了对齐最后一列的内容,您可以将其分成两列,或者只将重复的信息“@ 20°C”放在列标题中:
\documentclass[oneside,11pt]{book}
\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage[
expansion = false ,
tracking = smallcaps ,
letterspace = 40 ,
]{microtype}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{makecell}
\renewcommand{\theadfont}{\normalsize}
\begin{document}
\begin{table}
\centering
\begin{tabular}{
l
S[table-format=-2.2(1),table-number-alignment=left]
S[table-format=3.2(2),table-number-alignment=left]
S[table-format=2.1]@{\;}l}
\toprule
& {$T_m$ (\si{\celsius})} & {$\eta$ (\si{\milli\pascal})} & \multicolumn{2}{c}{$\sigma$ (\si{\siemens/\centi\meter})}\\
\midrule
A & 14(1) & 38(1) & 13 & @ \SI{20}{\celsius}\\
B & -85(2) & 104(4) & 3.6 & @ \SI{20}{\celsius}\\
\addlinespace
C & -1.71(7) & 32.2(6) & 8.8 & @ \SI{20}{\celsius}\\
D & -2.93(4) & 50.09(90) & 3.9 & @ \SI{20}{\celsius}\\
\bottomrule
\end{tabular}
\caption{Caption.}
\end{table}
\begin{table}
\centering
\begin{tabular}{
l
S[table-format=-2.2(1)]
S[table-format=3.2(2)]
S[table-format=2.1]}
\toprule
& {$T_m$ (\si{\celsius})} & {$\eta$ (\si{\milli\pascal})} & {\thead[t]{$\sigma$ (\si{\siemens/\centi\meter})\\ @\SI{20}{\celsius}}}\\
\midrule
A & 14(1) & 38(1) & 13 \\
B & -85(2) & 104(4) & 3.6 \\
\addlinespace
C & -1.71(7) & 32.2(6) & 8.8 \\
D & -2.93(4) & 50.09(90) & 3.9 \\
\bottomrule
\end{tabular}
\caption{Caption.}
\end{table}
\end{document}