[Tex/LaTex] bug in tabu when rowcolors are defined

colortabu

In the following code the vertical separation from cell to the bottom is negative instead of the defined \tabulinesep=5pt when \rowcolor{headcolor} and and \rowfont are defined.

\documentclass[]{scrartcl} 
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[table]{xcolor}
\usepackage{tabu}
  \tabulinesep=5pt
\listfiles
\begin{document}
\colorlet{headcolor}{gray!25}
\begin{tabu} to 0.8\textwidth{X[1,L]X[1,L]}
    \hline
    \rowcolor{headcolor}
    \rowfont[l]{\bfseries}%
     head & head \tabularnewline
    \hline
    text which is considerably longer than the width of the column &
    text which is considerably longer than the width of the column \\
    \hline
\end{tabu}
\end{document}

Here the visual result

enter image description here

Is this a bug in the tabu package? I contacted the author of tabu, but got no answer in the last days.

Best Answer

\rowcolor is defined by colortbl. So it's an incompatibility between the two packages. You can fix that by using the tabu command \taburowcolors instead:

\colorlet{headcolor}{gray!25}
\begin{tabu} to 0.8\textwidth{X[1,L]X[1,L]}
    \hline
    \taburowcolors 1{headcolor .. headcolor}
    \rowfont[l]{\bfseries}%
     head & head \tabularnewline
    \taburowcolors 1{white .. white}
    \hline
    text which is considerably longer than the width of the column &
    text which is considerably longer than the width of the column \\
    \hline
\end{tabu}

tabu example with colored row

Related Question