Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have this minimal example:

\documentclass{article}
\usepackage{colortbl}
\usepackage{longtable}
\usepackage{tabu}

\begin{document}

\begin{longtabu} {|ll|}
  a & \begin{tabu}{l}
    1 \\
    red 2 \\
  \end{tabu} \\
\end{longtabu}

\end{document}

Using pdflatex from texlive 20120628 on cygwin gives me this error:

! Missing number, treated as zero.
<to be read again>
               \tabu@1.H0
l.13 \end{longtabu}

If I leave out \usepackage{colortbl} the error is gone. Unfortunately my actual document is a lot larger and I need this package.

Using pdflatex from MiKTex 2.9 gives me no error.

Where does this error come from and how can I fix it? I need to be able to compile this document using texlive as well.

share|improve this question
    
tabu has its own methods for coloring cells; it should check for compatibility with the standard LaTeX tools, though, but apparently it doesn't. –  egreg Nov 9 '12 at 0:36
add comment

1 Answer

Hmm appears tabu doesn't want to nest. This works round it:

\documentclass{article}
\usepackage{colortbl}
\usepackage{longtable}
\usepackage{tabu}

\begin{document}

\newsavebox\grumble
\savebox\grumble{%
\begin{tabu}{l}
    1 \\
    red 2 \\
  \end{tabu}%
}

\begin{longtabu} {|ll|}
  a & \usebox{\grumble} \\
\end{longtabu}

\end{document}

enter image description here

share|improve this answer
1  
Since my code is partially generated it is difficult to use your suggested method. Looking further into this I discovered that texlive uses version v1.0a of the colortbl package while MiKTex uses version v0.1j. This explains the different behavior. Copying the older colortbl.sty file next to my .tex file solves the compilation error. –  user21903 Nov 8 '12 at 12:31
    
ah that's unfortunate as it means it is harder to blame the author of tabu. Clearly one wouldn't want to blame the author of colortbl. I'll see if I can see what the difference is. –  David Carlisle Nov 8 '12 at 12:48
    
@David Carlisle: On a fully updated MikTex 2.9 distribution I am experiencing the same problem. I wonder whether there is some solution you would suggest. –  Marcos Jan 18 '13 at 17:29
    
@Marcos: For me this is also true. I have a TeX document here, which is also using tabu in conjunction with colortbl and nested tabu environments. When I compile this document using a fully-updated MiKTeX system with colortbl v1.0a I'm running into the same errors, but using version v0.1j of colortbl, I have no problems. –  DigNative May 6 '13 at 17:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.