[Tex/LaTex] siunitx rounding in table with parentheses

formattingsiunitxtables

I'm trying to create a standard regression table with standard errors in parentheses below the coefficients, while using siunitx to align the numbers on the decimal point, and to round the numbers.

I use the option input-symbols=() to make siunitx ignore the parentheses, which works fine for alignment, but the numbers in parentheses are not rounded:

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{l*{2}{S[input-symbols=(),round-mode=figures,round-precision=1]}} 
\hline
& \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} \\
\hline
X & 0.0131     & 0.00265{***} \\
  & (0.000731) & (0.000547)   \\
\hline
\end{tabular}
\end{document}

If I instead put the parentheses in curly brackets, the rounding works, but the left paranthesis ends up left aligned in the table cell:

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{l*{2}{S[round-mode=figures,round-precision=1]}} 
\hline
  & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} \\
\hline
X & 0.0131         & 0.00265{***}   \\
  & {(}0.000731{)} & {(}0.000547{)} \\
\hline
\end{tabular}
\end{document}

Is there a way to get rounding to work with parantheses? I have the latest version of siunitx, 2.4j.

Best Answer

The following appears to work:

\documentclass{article}

\usepackage{siunitx}
    \sisetup{
        detect-mode,
        tight-spacing           = true,
        group-digits            = false,
        input-signs             = ,
        input-symbols           = ,
        input-open-uncertainty  = ,
        input-close-uncertainty = ,
        table-align-text-pre    = false,
        round-mode              = figures,
        round-precision         = 1,
        table-space-text-pre    = (,
        table-space-text-post   = ),
        }

\begin{document}
\begin{tabular}{l*{2}{S}} 
\hline
& \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} \\
\hline
X & 0.0131     & 0.00265*** \\
  & (0.000731) & (0.000547)   \\
\hline
\end{tabular}
\end{document}