josephwright / siunitx

A comprehensive (SI) units package for LaTeX
LaTeX Project Public License v1.3c
356 stars 26 forks source link

Asymmetric uncertainties in tables #686

Closed kh296 closed 1 year ago

kh296 commented 1 year ago

Symmetric uncertainties can be specified in the S columns of tables without needing to be explicitly passed to a macro, but a similar approach with asymmetric uncertainties gives an error. As a minimal example, the following:

\documentclass[a4paper]{article}
\usepackage[separate-uncertainty]{siunitx}
\begin{document}
\begin{table}
\begin{tabular}{S[table-format=2.2(1)]}
\num{20.01(2:3)} \\ % Asymmetric uncertainties with macro okay.
20.01(2) \\ % Symmetric uncertainties without macro okay.
30.01(2:3) \\ % This line gives an error.
\end{tabular}
\end{table}
\end{document}

generates the error message:

! Package siunitx Error: Invalid number '30.01(2'

It would be nice if asymmetric uncertainties in tables could also be specified without a macro.

Thanks!