根据先前问题我创建了下面给出的 MWE。我不明白的是,我收到了三个Overfull \hbox (9.9778pt to wide)
警告。它们从何而来,因为它们没有出现在最后的超额/不足警告中,如何更改才能消除它们?
梅威瑟:
\documentclass{memoir}
\usepackage{siunitx}
\usepackage{calc}
\begin{document}
\begin{table}[tbp]
\def\pm{\kern2.2pt\mathchar"2206}
\newlength{\tabcolseptemp}
\setlength{\tabcolseptemp}{\widthof{$\pm$}}
\addtolength{\tabcolseptemp}{10pt}
\centering
\sisetup{
table-figures-integer = 1,
table-figures-decimal = 1,
table-number-alignment = center,
output-decimal-marker = {,},
input-signs=,input-symbols=\pm
}
\begin{tabular}{S[table-figures-integer = 1,table-figures-decimal = 1] @{\hskip \tabcolseptemp} S[table-figures-integer = 2,table-figures-decimal = 1] @{\hskip \tabcolseptemp} S[table-figures-integer = 2,table-figures-decimal = 1]}
\toprule
\multicolumn{1}{c}{\boldmath{$A$}}
& \multicolumn{1}{c}{\boldmath{$B$}}
& \multicolumn{1}{c}{\boldmath{$C$}} \\
\midrule
1.5 \pm & 12.0 \pm & 15.0 \pm \\ 1.0 & 2.0 & 3.0 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
答案1
有一个更简单的方法:
\documentclass{memoir}
\usepackage{siunitx}
\newcommand{\tpm}{\ensuremath{\,\pm}}
\begin{document}
\begin{table}[tbp]
\centering
\sisetup{
output-decimal-marker = {,},
}
\begin{tabular}{
S[table-format=1.1,table-space-text-post=\tpm]
S[table-format=2.1,table-space-text-post=\tpm]
S[table-format=2.1,table-space-text-post=\tpm]
}
\toprule
\multicolumn{1}{c}{\boldmath{$A$}} &
\multicolumn{1}{c}{\boldmath{$B$}} &
\multicolumn{1}{c}{\boldmath{$C$}} \\
\midrule
1.5 \tpm & 12.0 \tpm & 15.0 \tpm \\
1.0 & 2.0 & 3.0 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}