The question was answered by the developer on comp.text.tex and I thought I share it here to answer the question:
Well. In next version, thank to Bruno
Le Floch rewritting process, there is
no \tabucolumn command:
\newcolumntype Z{ XS[m,
tight-spacing=true,round-mode=places,
round-precision=2] }
X[options]{S[option]} is implemented
as XS[ X option , S option] but both
still work.
\tabucolumn indeed has no signifiance:
I put it there due to some potential
parsing problems of the tabu preamble.
Problems that no more exist thank to B
Le Floch.
XS ( or X[..]{S[...]} ) is always
centered: there is no point to set the
horizontal alignment for S and s
columns: the alignment can't be
chosen.
\begin{tabu} to \linewidth {X[l,m,1.2]ZZZZZ}
Avoid X[l,m,1.2] -> for XS columns
the comma is "reserved" to separate
the options of X with the options for
S. Thus it's good practice not to use
any delimiter for X options :
X [1.2 lm] (and more readable imho)
\hline
Water vapour*& 18.01534& -2.418379e+8& 1.886964e+5&
2.605& 572.4\\
\hline
\end{tabu}
Now the problem of the vertical
alignment: ;-)
The problem is not tabu but siunitx
(sorry ;-( ): siunitx leaves too much
fixed space before the numbers,
because the S column mechanism
proceeds with "fixed width". To be
able to adjust the spacing, the S
column should read the whole tabular
and then choose the spacing depending
on the "natural length" of each
typeset number in each column.
This is what is done inside tabu X,
but tabu cannot adjust the spacing
made by siunitx: the spaces are inside
a box, and tabu can't destroy the box
(and thereafter re-align the numbers !
)
If you try with:
\newcolumntype Z{X[-1
m]{S[tight-spacing =
true,round-mode=places,
round-precision=2]}}
\begin{tabu} to \linewidth {X[lm] |
*5{Z|}} \hline Water vapour* & 18.01534 & -2.418379e+8 & 1.886964e+5 &
2.605& 572.4\\ \hline \end{tabu}
There is no more problems of
alignment. But the columns width are
not the same. You can understand the
problem with :
\newcolumntype Z{S[tight-spacing =
true,round-mode=places,
round-precision=2]}
\begin{tabu} to \linewidth {X[-1 lm] |
*5{Z|}} \hline Water \par vapour* & 18.01534 & -2.418379e+8 & 1.886964e+5 &
2.605& 572.4\\ \hline \end{tabu}
This shows that siunitx needs more
space than the X coefs allow. Hence
the line break inside the X[m] ( ie m
) column.
So: change your margin, or
artificially raise the tabu width:
\newcolumntype Z{X[m]{S[tight-spacing
= true,round-mode=places,
round-precision=2]}}
\hskip-10mm \begin{tabu} to 500pt
{X[-1 lm] | *5{Z|}} \hline Water \par
vapour* & 18.01534 & -2.418379e+8 &
1.886964e+5 &
2.605& 572.4\\ \hline \end{tabu}
Here there is no more problem. (for
future version 2.9 at least)
Here's a solution that specifies the table-format
for each column; note that I also grouped {23e-5}
\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table} \centering
{\small
\begin{tabular}{S[table-format=3.2]S[table-format=2.3]}
\toprule
{x} &{x} \\
\midrule
123 & {23.0e-5} \\
123.0 & 23\\
0.23 & 1.423 \\
0.23 & 1 \\
\bottomrule
\end{tabular}}
\end{table}
\end{document}
Best Answer
The format for the
S
columns should reflect the actual values. For centering the header one could use\multicolumn{1}{c}{...}
, but just enclosing the value in braces stopssiunitx
to use the alignment of numbers and use the default, which is centering (thanks to Qrrbrbirlbel for noting it)There is no need to use
\multirow
; I believe that placing "PEP" next to the horizontal rule ruins the table. Of course\textsc
does nothing to it.