尝试舍入时 siunitx 数字太大

尝试舍入时 siunitx 数字太大

使用siunitx

\usepackage{siunitx}

我试图将具有大量小数位的数字放入表格中,同时将其四舍五入为小数点后 3 位。出现编译错误! Number too big.。我试图将预期数字改为一千,但这不起作用:

\begin{table}
  \sisetup{
    table-number-alignment = center,
    table-figures-exponent = 1000,
    table-figures-integer = 1000,
    table-figures-uncertainty = 1000,
    table-figures-decimal = 1000,
    table-sign-mantissa,
    table-sign-exponent,
    table-auto-round
  }
  \begin{tabular}{
    S
    S
    S
    S
  }
  0.2 & 0.6903200460356393 & 0.625 & -6.532004603563935e-2 \\ 
  \end{tabular}
\end{table}

有解决办法吗?

答案1

最新siunitx版本已经修复了这个问题(尝试 v2.4j 或更高版本),不过你table-figures-exponent = 1000还是会失败。尝试

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{table}
  \sisetup{
    table-format = -1.3e-1,
    table-number-alignment = center,
    table-auto-round
  }
  \begin{tabular}{
    S
    S
    S
    S
  }
  0.2 & 0.6903200460356393 & 0.625 & -6.532004603563935e-2 \\ 
  \end{tabular}
\end{table}
\end{document}

相关内容