LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Missing number, treated as zero. \end{tabularx}

Information and discussion about graphics, figures & tables in LaTeX documents.
AndyStoeckli
Posts: 2
Joined: Fri Jan 11, 2019 9:57 am

Missing number, treated as zero. \end{tabularx}

Hi all,

I'm new in this forum but use LaTex for a long time. With the newest update for MikTex (downloaded from the website yesterday) I have now faced a problem with the following kind of table.
\usepackage{tabularx}	% Tablex has a special specifier (X) for strechting the table width\usepackage{color,colortbl} \begin{center}	\begin{scriptsize}		\rowcolors{1}{White}{Gray}		\setcounter{cTestStep}{1}		\captionsetup{type=table}		\begin{tabularx}{0.9\textwidth}{p{0.05\textwidth}p{0.1\textwidth}p{0.1\textwidth}Xp{0.05\textwidth}p{0.2\textwidth}}			\toprule			\textbf{Ref}            & \textbf{Document type} & \textbf{Document number} & \textbf{Name}               & \textbf{Rev.} & \textbf{Content}       \\ \midrule			\printandinc{cTestStep} & pdf                    & -                        & VBE-Comicon\_protocol\_ver0\_3 & 0.3           & Communication protocol \\			\printandinc{cTestStep} &                        &                          &                             &               &                        \\			\printandinc{cTestStep} &                        &                          &                             &               &                        \\			\printandinc{cTestStep} &                        &                          &                             &               &                        \\ \bottomrule		\end{tabularx}  		\caption{\label{Applicable documents}Applicable documents}		\end{scriptsize}\end{center}

Now, the complete document gives a huge amount of errors back. Removing \rowcolors solves the problem but then with the lack of coulored rows.

Error Message:Missing number, treated as zero. \end{tabularx}Illegal unit of measure (pt inserted). \end{tabularx}

Best regards
Andy
Last edited by Stefan Kottwitz on Fri Jan 11, 2019 4:51 pm, edited 1 time in total.
Reason: code marked

Stefan Kottwitz
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm
Hi Andy,

welcome to the forum!

In the code above there are some details missing, such as which packages are needed and loaded (booktabs and caption are required), the counter definition for cTestStep, and the definition of \printandinc.

If I try to re-create the missing stuff, the error doesn't appear:

\documentclass[12pt]{article}\usepackage{tabularx}	% Tablex has a special specifier (X) for strechting the table width\usepackage{color,colortbl}\newcounter{cTestStep}\usepackage{caption}\usepackage{booktabs}\begin{document}\begin{center}	\begin{scriptsize}		%\rowcolor{1}{White}{Gray}		\setcounter{cTestStep}{1}		\captionsetup{type=table}		\begin{tabularx}{0.9\textwidth}{p{0.05\textwidth}p{0.1\textwidth}p{0.1\textwidth}Xp{0.05\textwidth}p{0.2\textwidth}}			\toprule			\textbf{Ref}            & \textbf{Document type} & \textbf{Document number} & \textbf{Name}               & \textbf{Rev.} & \textbf{Content}       \\ \midrule			\thecTestStep\stepcounter{cTestStep} & pdf                    & -                        & VBE-Comicon\_protocol\_ver0\_3 & 0.3           & Communication protocol \\			\thecTestStep\stepcounter{cTestStep} &                        &                          &                             &               &                        \\			\thecTestStep\stepcounter{cTestStep} &                        &                          &                             &               &                        \\			\thecTestStep\stepcounter{cTestStep} &                        &                          &                             &               &                        \\ \bottomrule		\end{tabularx}  		\caption{\label{Applicable documents}Applicable documents}		\end{scriptsize}\end{center}\end{document}

It compiles without problems. So perhaps you are doing something else in addition? Can you post a complete small code example that brings the error when we compile it, based on your code?

Stefan

AndyStoeckli
Posts: 2
Joined: Fri Jan 11, 2019 9:57 am
Dear Stefan,

I'm currently out of office, but as soon as I'm back I'll send you a code example. Meanwhile I tried also texlive and with this compiler everything worked fine. Also with the old MikTex compiler everything is working fine. It's really strange

Best regards
Andy