7

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}
6
  • Welcome to TeX.SE. Adding group-digits=false (I believe group-decimal-digits=false is now deprecated but still works) to the \ssisetup should fix it. Commented Mar 28, 2012 at 22:49
  • A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). I took the liberty to format you post a little. See this link for more details on available formatting. Commented Mar 28, 2012 at 22:50
  • @PeterGrill Make that a) group-digits=false b) an answer. :-)
    – lockstep
    Commented Mar 28, 2012 at 22:53
  • @lockstep: Seems to work for me with MikTeX but not TeXLive. Commented Mar 28, 2012 at 22:56
  • @ Peter Grill. Thank you so much. It works perfectly.
    – Saurin
    Commented Mar 28, 2012 at 22:57

3 Answers 3

7

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}
5

You need to add group-digits=false to the \sisetup which yields:

enter image description here

Note:

  • The use of group-decimal-digits=false appears to work with MikTeX 2.8, but not TeXLive 2011 so should be avoided.
2

You can also use parse-numbers = false, in the \sisetup.

\documentclass[12pt]{article}

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

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

\sisetup{parse-numbers = false,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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .