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.

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.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

\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

share|improve this answer
1  
Ok, but that is a different command with a different usage. It can be used to implement the same colors with a different approach. So in my example \rowcolor is showing a bug in tabu environments. –  Matthias Pospiech Nov 25 '11 at 8:24
    
Unfortunately, that does not work with \multicolumn :-( –  Frederick Nord Feb 14 '13 at 15:40

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.