# ! Package array Error: Illegal pream-token (s): c' used as well as No output of units using siunitx

I am trying to create a table using tabular environment. However I am getting two errors. The first error is the one where there is an illegal pream-token (s): c' used. The second problem is that I don't get any output under the units columns. Kinldy refer to where I used the SI units in my MWE for the specification of location units and area units.

\documentclass[journal,twoside]{IEEEtran}
\usepackage[a4paper,left=1.5cm, right=1.5cm, bottom=1.5cm,top=1.5cm]{geometry}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}

\begin{document}

\begin{table*}[!ht]
\caption{NLOS Simulation parameters}
\label{tab:NLOSSim}
\centering
\smallskip
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}l l s l l s}
\hline
\hline
\cmidrule(c){1-3}\cmidrule(c){4-6}
Parameter & Value & \mc{Units} & Parameter & Value & \mc{Units}\\
\midrule
Room size & $5\times 5\times 3$ & \cubic\metre & Location\left(x,y,z\right) & \left(1.5, 1.5, 0\right) & \\
\rho_{n}=\rho_{s}=\rho_{e}=\rho_{w} & 0.8 & & Active area \left(A_{r} \right) & 1 & \centi\metre\\

\hline
\hline
\end{tabular*}
\end{table*}

\end{document}


I appreciate any input to help me solve this problem. What I am getting is shown on the screenshot below.

• Welcome to TeX.SE. You need to either provide a definition of the s column type or load a package that provides such a definition. (The siunitx package may, or may not, be a candidate.) – Mico May 3 at 12:07
• Be careful about the combination of caption package and IEEEtran, this is not supported – user188004 May 3 at 12:09
• The instruction \cmidrule(c){1-3} is bound to throw an error message as well. Not sure what you're trying to achieve, but \cmidrule(lr){1-3} may be the way to go. – Mico May 3 at 12:10
• So to sum up: add \usepackage{siunitx} after the other usepackage statements, change \cmidrule(c) to \cmidrule(lr), and add math switches at appropriate places in the last two lines of the table. – Marijn May 3 at 12:16
• Thank you all very much for your help. I had actually made a mistake deleting some of the items on my preamble for the MWE and I deleted the 'siunitx' package when I posted my question. – Allycan Mapunda May 3 at 14:28

\documentclass[journal,twoside]{IEEEtran}
\usepackage[a4paper,left=1.5cm, right=1.5cm, bottom=1.5cm,top=1.5cm]{geometry}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{array}
\usepackage{booktabs}
\usepackage{siunitx}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}

\begin{document}

\begin{table*}[!ht]
\caption{NLOS Simulation parameters}\label{tab:NLOSSim}
\smallskip \def\arraystretch{1.4}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}l l s l l s}\hline\hline
Parameter & Value & \mc{Units} & Parameter & Value & \mc{Units}\\\midrule
Room size & $5\times 5\times 3$ & \cubic\metre & Location $\left(x,y,z\right)$ & $\left(1.5, 1.5, 0\right)$ & \\
$\rho_{n}=\rho_{s}=\rho_{e}=\rho_{w}$ & 0.8 & & Active area $\left(A_{r} \right)$ & 1 &
\centi\metre\\\hline\hline
\end{tabular*}
\end{table*}

\end{document}


I would like to recommend that you re-organize your table so that it fits within a single column.

\documentclass[journal,twoside]{IEEEtran}
\usepackage[a4paper,margin=1.5cm]{geometry}
\usepackage{amsmath,amsthm,amssymb,graphicx}
\usepackage{newtxtext,newtxmath} % optional
\usepackage[utf8]{inputenc}
\usepackage{tabularx,booktabs}
\usepackage{siunitx} % for 's' column type
\usepackage{lipsum} % filler text
\begin{document}

\begin{table}[ht!]
\caption{NLOS Simulation parameters}
\label{tab:NLOSSim}
\centering
\begin{tabular}{@{} lls @{}}
\toprule
Parameter & Value & {Units} \\
\midrule
Transmitter\\
Room size & $5\times 5\times 3$ & \cubic\metre \\
$\rho_{n}=\rho_{s}=\rho_{e}=\rho_{w}$ & $0.8$ \\
Location $(x,y,z)$ & $(1.5, 1.5, 0)$ \\
Active area $(A_{r})$ & $1$ & \centi\metre\\