[Tex/LaTex] siunitx: Alignment Problems with numbers in parenthesis

horizontal alignmentsiunitxtables

The example given below gives me a strange offset in 4th decimal place in the parenthesis. Interestingly, this problem arose only after I updated my Miktex 2.8 to Miktex 2.9. I don't know whats causing this is slight shift in the last decimal point in the second row.

enter image description here

Here is the code for above output.

\documentclass[12pt]{article}

\usepackage{amsfonts}
\usepackage{amsmath,array}
\usepackage[detect-all]{siunitx}
\usepackage[margin=1 in]{geometry}
\usepackage{booktabs, longtable}
\usepackage[english]{babel}

\begin{document}
\begin{table}[htbp]
\footnotesize
 \centering

\sisetup{input-symbols=(), table-figures-integer = 3, table-figures-decimal = 4, table-number-alignment = center} 

\begin{tabular}{lSSSSSS}

\toprule
            & {\bf (A)} & {\bf (B)} & {\bf (C)} & {\bf (D)} & {\bf (E)} & {\bf (F)} \\
\hline \midrule
     & 0.0016*** & 0.0013*** & 0.0015*** & 0.0015*** & 0.0009** & 0.0009** \\
          & (0.0005) & (0.0005) & (0.0006) & (0.0006) & (0.0004) & (0.0005) \\
     &       &       &       & 0.1324*** & 0.1202*** & 0.1203*** \\
          &       &       &       & (0.0131) & (0.0118) & (0.0118) \\
 &       &       &       & -0.0549*** & -0.0569*** & -0.0569*** \\
          &       &       &       & (0.0023) & (0.0024) & (0.0024) \\
    \hline \bottomrule
    \end{tabular}
\end{table}
\end{document}

Best Answer

I would probably set the table setup like this:

\sisetup{
  input-symbols         = (),
  table-format          = -1.5,
  table-space-text-post = ***,
  table-align-text-post = false,
  group-digits          = false
}

Setting the *** as text and add a proper table-format (a sign, one digit before the decimal point, 5 after it (counting the closing brace, too)) should get the spacing between the columns right. The option table-align-text-post = false shifts the *** next to the numbers.

In your example the *** and the minus in the column to the right nearly seem to touch each other and in the last columns the *** protrude the table lines.

enter image description here

Full example:

\documentclass[12pt]{article}

\usepackage{amsfonts}
\usepackage{amsmath,array}
\usepackage[detect-all]{siunitx}
\usepackage[margin=1 in]{geometry}
\usepackage{booktabs, longtable}
\usepackage[english]{babel}

\begin{document}

\begin{table}[htbp]
\footnotesize\centering
\sisetup{
  input-symbols         = (),
  table-format          = -1.5,
  table-space-text-post = ***,
  table-align-text-post = false,
  group-digits          = false
} 
\begin{tabular}{lSSSSSS}
 \toprule
  & {\bfseries(A)} & {\bfseries(B)} & {\bfseries(C)} & {\bfseries(D)}  & {\bfseries(E)}  & {\bfseries(F)} \\
 \hline \midrule
  & 0.0016*** & 0.0013*** & 0.0015*** & 0.0015***  & 0.0009**   & 0.0009** \\
  & (0.0005)  & (0.0005)  & (0.0006)  & (0.0006)   & (0.0004)   & (0.0005) \\
  &           &           &           & 0.1324***  & 0.1202***  & 0.1203*** \\
  &           &           &           & (0.0131)   & (0.0118)   & (0.0118) \\
  &           &           &           & -0.0549*** & -0.0569*** & -0.0569*** \\
  &           &           &           & (0.0023)   & (0.0024)   & (0.0024) \\
 \hline \bottomrule
\end{tabular}
\end{table}
\end{document}
Related Question