Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
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. –  Peter Grill Mar 28 '12 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. –  Peter Grill Mar 28 '12 at 22:50
    
@PeterGrill Make that a) group-digits=false b) an answer. :-) –  lockstep Mar 28 '12 at 22:53
    
@lockstep: Seems to work for me with MikTeX but not TeXLive. –  Peter Grill Mar 28 '12 at 22:56
    
@ Peter Grill. Thank you so much. It works perfectly. –  Saurin Mar 28 '12 at 22:57
show 1 more comment

3 Answers

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
  & {\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}
share|improve this answer
add comment

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

share|improve this answer
add comment

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.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.