6

The following document compiles just fine, but the seemingly trivial addition of \color{white} to the call to \rowfont in the table's header line changes the vertical spacing of the text. My question: how can I convince LaTeX to have a white text in the header row without changing its position?

Remark: The behaviour is not triggered by the beamer document class. I get the same result when switching to, say, scrartcl. I just prepared the MWE from the document I just happened to edit.

Screenshot

tabu-vertical-position-snafu

Code

\documentclass[xcolor=table]{beamer}
\usepackage{tabu}

\newcommand{\thecontent}{%
\taburowcolors{white!45!blue .. white!!blue} & Foo & Bar \\
\taburowcolors{white!90!blue .. white!95!blue}
A & 1 & 2 \\
B & 3 & 4 \\
C & 5 & 6}

\begin{document}

\begin{frame}
\tabulinesep=^3pt % just for aesthetics; does not change problem

Good position, but black header row:
\begin{tabu}{XX[2]X[2]}%
\rowfont{\bfseries}%
\thecontent
\end{tabu}
\bigskip

White text, but bad position:
\begin{tabu}{XX[2]X[2]}%
\rowfont{\bfseries\color{white}}%
\thecontent
\end{tabu}
\end{frame}
\end{document}

1 Answer 1

8

Use

\rowfont{\bfseries\leavevmode\color{white}}%

see the footnote on page 6 of texdoc grfguide (which translates roughly as sorry, it's not my fault)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .