## 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.
1. \usepackage{tabularx} % Tablex has a special specifier (X) for strechting the table width
2. \usepackage{color,colortbl}
3.
4. \begin{center}
5. \begin{scriptsize}
6. \rowcolors{1}{White}{Gray}
7. \setcounter{cTestStep}{1}
8. \captionsetup{type=table}
9. \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}}
10. \toprule
11. \textbf{Ref} & \textbf{Document type} & \textbf{Document number} & \textbf{Name} & \textbf{Rev.} & \textbf{Content} \\ \midrule
12. \printandinc{cTestStep} & pdf & - & VBE-Comicon\_protocol\_ver0\_3 & 0.3 & Communication protocol \\
13. \printandinc{cTestStep} & & & & & \\
14. \printandinc{cTestStep} & & & & & \\
15. \printandinc{cTestStep} & & & & & \\ \bottomrule
16. \end{tabularx}
17. \caption{\label{Applicable documents}Applicable documents}
18. \end{scriptsize}
19. \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.

1. Error Message:
2. Missing number, treated as zero. \end{tabularx}
3. 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: 9567
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:

1. \documentclass[12pt]{article}
2. \usepackage{tabularx} % Tablex has a special specifier (X) for strechting the table width
3. \usepackage{color,colortbl}
4. \newcounter{cTestStep}
5. \usepackage{caption}
6. \usepackage{booktabs}
7. \begin{document}
8. \begin{center}
9. \begin{scriptsize}
10. %\rowcolor{1}{White}{Gray}
11. \setcounter{cTestStep}{1}
12. \captionsetup{type=table}
13. \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}}
14. \toprule
15. \textbf{Ref} & \textbf{Document type} & \textbf{Document number} & \textbf{Name} & \textbf{Rev.} & \textbf{Content} \\ \midrule
16. \thecTestStep\stepcounter{cTestStep} & pdf & - & VBE-Comicon\_protocol\_ver0\_3 & 0.3 & Communication protocol \\
17. \thecTestStep\stepcounter{cTestStep} & & & & & \\
18. \thecTestStep\stepcounter{cTestStep} & & & & & \\
19. \thecTestStep\stepcounter{cTestStep} & & & & & \\ \bottomrule
20. \end{tabularx}
21. \caption{\label{Applicable documents}Applicable documents}
22. \end{scriptsize}
23. \end{center}
24. \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