我可以對不同的行使用不同的 siunitx "S" 表格式嗎?

我可以對不同的行使用不同的 siunitx "S" 表格式嗎?

在此表中,我想1.2+-1.2對除一行之外的所有行使用對齊方式。如何使第四行與其他行在加減號處對齊,但忽略小數點?

嘗試使用類似的格式將第四行對齊2.2+-2.2會產生太多空間。

在此輸入影像描述

\documentclass{memoir}
\usepackage[separate-uncertainty=true]{siunitx}
\begin{document}
\begin{tabular}{l*{3}{S[table-format=2.2+-2.2]}}
  one row & 1.7(8) & 2.1(11) & 1.9(08) \\
  another row & 1.1(7) & 1.1(07) & 1.2(06) \\
  a third row & 1.4(7) & 1.9(09) & 1.4(07) \\
  a special fourth row & 56(12) & 10(9) & 53(23) \\
  and number five & 0.85(08) & 0.84(0.10) & 0.85(0.08) \\
  and number six & 0.85(08) & 0.84(0.10) & 0.85(0.08) \\
\end{tabular}
\end{document}

答案1

\tablenum解決了這個問題。它需要包裝在多列中才能工作,此外,您需要選擇位數,以便加號與其他行對齊。

\documentclass{memoir}
\usepackage[separate-uncertainty=true]{siunitx}
\begin{document}
\begin{tabular}{l*{3}{S[table-format=1.2+-1.2]}}
  one row & 1.7(8) & 2.1(11) & 1.9(08) \\
  another row & 1.1(7) & 1.1(07) & 1.2(06) \\
  a third row & 1.4(7) & 1.9(09) & 1.4(07) \\
  a special fourth row
    & \multicolumn{1}{c}{\tablenum[table-format=2+-2]{56(12)}}
    & \multicolumn{1}{c}{\tablenum[table-format=2+-2]{10(9)}}
    & \multicolumn{1}{c}{\tablenum[table-format=2+-2]{53(23)}} \\
  and number five & 0.85(08) & 0.84(0.10) & 0.85(0.08) \\
  and number six & 0.85(08) & 0.84(0.10) & 0.85(0.08) \\
\end{tabular}
\end{document}

在此輸入影像描述

相關內容