LaTeX forum ⇒ Graphics, Figures & TablesMissing 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}

Postby AndyStoeckli » Fri Jan 11, 2019 10:12 am

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}


Thanks in advance for your help.

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 9405
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Jan 11, 2019 5:06 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
Site admin

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

Postby AndyStoeckli » Thu Jan 24, 2019 11:49 pm

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


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 5 guests