4

I have to put a bunch of numbers into a lab report, and I currently use siunitx with tabular and the S column type. It looks great for small numbers and large column heads. However, for small heads and long numbers that extend only to the right of the decimal separator, it lokks pretty bad:

http://wstaw.org/m/2013/10/31/x.png

How could I have the head centered over the whole number, not centered above the comma? The table is too wide for the page, although it could be smaller.

  • 1
    Dan's answer is likely correct, but there are a couple of things I'd alter as well. Each column has a common factor, so I'd give the first in 10(0), the second and third divided by 10(-7). An error of '349' is meaningless: the values really should be rounded. – Joseph Wright Nov 1 '13 at 6:53
  • I ended up using less digits and putting the exponent into the header. The tables look way better now. Could you transform your comment into an answer, so that I could accept it. – Martin Ueding Dec 12 '13 at 8:54
6

You really should include a minimal working example (MWE). However, I can guess that you need one of the options that the S column provides. For example:

\documentclass{article}
\usepackage{siunitx}
\usepackage{booktabs}

\begin{document}

\begin{tabular}{S[table-number-alignment = center,table-figures-integer=2,
table-figures-decimal=10,table-figures-exponent=2]}
\toprule
  {Some Values} \\
\midrule
  2.34561234\\
  4.2345 \\
 -6.7835 \\
  0.473 \\
  2.5 \\
  1.2345678910e-7\\
\bottomrule
\end{tabular}

\end{document}

The result is:

enter image description here

The table-number-alignment option all by itself would be sufficient if the heading were wider that the widest number but, as that is not the case, the table-figure-* options tell siunitx how much space to reserve for the different parts of the numbers.
There are other options, found in the documentation (siunitx.pdf), section 5.14, page 46 and following (for version 2.58).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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