# Puzzling error while using sunitx (in a tabular environment)

I've been working on writing a contingency table in LaTeX (I've prepared myself for a long battle to get multi-line and multi-column cells to appear as I need).

\usepackage{booktabs}
\usepackage[detect-all]{siunitx}
\usepackage{multirow}

\begin{table}[htp]
\centering
\begin{tabular}{
@{}
l
S[table-format=3.2]
S[table-format=3.2]
S[table-format=3.2]
S[table-format=3.2]
S[table-format=3.2]
S[table-format=3.2]
@{}
}
\toprule
\multicolumn{7}{|c|}{Factor B} \\
& Alpha & Beta & Gamma & Delta & Epsilon & Row Total \\

\midrule
\multirow{2}{*}{Alpha} & 1 & 1 & 1 & 1 & 1 & 1 \\
& 11.11 & 2.11 & 3.11 & 4.11 & 5.11 & \\
\multirow{2}{*}{Beta} & 2 & 2 & 2 & 2 & 2 & 2 \\
& 22.22 & 2.22 & 3.22 & 4.22 & 5.22 & \\
\multirow{2}{*}{Gamma} & 3 & 3 & 3 & 3 & 3 & 3 \\
& 33.33 & 2.33 & 3.33 & 4.33 & 5.33 & \\
\multirow{2}{*}{Delta} & 4 & 4 & 4 & 4 & 4 & 4 \\
& 44.44 & 2.44 & 3.44 & 4.44 & 5.44 & \\
\multirow{2}{*}{Epsilon} & 5 & 5 & 5 & 5 & 5 & 5 \\
& 55.55 & 2.55 & 3.55 & 4.55 & 5.55 & \\
Column Total & 111 & 222 & 333 & 444 & 555 & 666 \\

\bottomrule
\end{tabular}
\caption {Table Caption}\label{my-table}
\end{table}


I receive the following error:

! siunitx Error

(siunitx) Invalid numerical input 'e'.

For immediate help type H <return>.
...

l.157          & Alpha & Beta &
Gamma & Delta & Epsilon & Row Total \\


I admit I don't understand it. The non-numerical text is in the header of the table. To see the table, replace the line

    & Alpha & Beta & Gamma & Delta & Epsilon & Row Total \\


with

    1 & 2 & 3 & 4 & 5 & 6 & 7 \\


just to allow it to render.

I'm puzzled. Why "e"?

Suggestions are very appreciated.

Thanks in advance.

-

## 1 Answer

The "e" is because siunitx is trying to parse "Delta" as a number in engineering notation (eg, 1.234E+04). Fix it by writing the headings as \multicolumn{1}{c}{Delta}, etc

-
Thanks. Can you share how did you learn this? I certainly understand that trying to parse "Delta" as a number would fail but 2 more things are not clear to me: (a) why "D" was allowed (is it part of a numeric notation?) and (b) why wrapping the column labels in \multicolumn... worked. I wouldn't even have dreamed of doing that! –  wishihadabettername Oct 3 '10 at 11:49
a) I presume the problem is because the "e" of "Delta" looks like the exponential E of engineering notation. b) wrapping in \multicolumn{1}{c}{...} interprets the headings using the "c" column specifier instead of the "S[table-format=3.2]" specifier. –  Lev Bishop Oct 3 '10 at 15:41
You can simply put header strings wrapped into curly brackets: & {Alpha} & {Beta} & {Gamma} & {Delta} & {Epsilon} & {Row Total} –  juanmah Feb 6 '12 at 15:24