I would like to use ctable
in my thesis for tables and graphics and I also would like to use siunitx
for formatting numbers and aligning numbers on the decimal marker in tables.
Everything seemed to work well until I discovered some strange behaviour in the last column. The heading does not get centered there (I tried the different settings for siunitx
: table-alignment, table-text-alignment, in the preamble and for the specific column). It did not help.
ctable version is rev 26694, v 1.23;
siunitx is rev 29017, v 2.5p
This is my minimal example:
\documentclass[english]{book}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{ctable}
\usepackage{siunitx}
\begin{document}
% Does not center the heading in the last column.
\ctable[]{
|l
|S
|S
|S|
}{}{
\FL
& {Tom} & {Suzy} & {Rob} \ML
Eating & 122.5 & 1.025 & 1.5 \NN
Sleeping & 9.1 & 1346.5 & 213.7 \NN
Working & 7.5 & 9.5 & 2.0125 \NN
Watching TV & 5.25 & 117.5 & 7.5 \LL}
% Works fine with simple tabular
\begin{tabular}{
|l
|S
|S
|S|
}
\hline
& {Tom} & {Suzy} & {Rob} \\ \hline
Eating & 122.5 & 1.025 & 1.5 \\
Sleeping & 9.1 & 1346.5 & 213.7 \\
Working & 7.5 & 9.5 & 2.0125 \\
Watching TV & 5.25 & 117.5 & 7.5 \\ \hline
\end{tabular}
\end{document}
This is how it looks to me:
|S|
to|S|@{}l@{}
, and the changing{Rob} \ML
to{Rob} &\ML
.S
column needs to see either & or \\ to know where it ends and\ML
is not good when there's\multicolumn
. I tried to find an answer by Joseph Wright, but didn't find it.\ML
to\tabularnewline \midrule
which is the same thing, but works&
, \\ and with \\tabularnewline. I will use those commands together with the original booktabs-commands in the future. To me those are easier to read and remember anyway. Problem solved :-) But to mark it as such it would net an answer, right?