I have tables in a beamer presentation, and I would like to highlight table rows sequentially (not necessarily in row order) using overlay specifications. So I would like to be able to write code similar to the following:

    Row 1  & Row 1 \\
    Row 2  & Row 2

with the effect that Row 1 is highlighted in red in the first slide and Row 2 is highlighted in the second slide.

I am using a tabu environment with dcolumn type columns. Here are some additional details about the findings I've made so far:

  1. In another post I found code to define a command dcolcolor to be able to colour dcolumn text.
  2. In order to colour the whole row's text without specifying each cell individually, I use \rowfont from tabu.
  3. In order to make \rowfont{\dcolcolor{...}} overlay specification-aware, I try to follow the directions in section 9.6.1 of the beamer user guide.

However, I could not get it to work. So I tried using only on \rowfont{...} without trying to define a new, overlay specification-aware command, and I got an error. Here is a MWE:






% All of row 1 should be red on all slides
Row 1 & 1.234 & 1.234 \
% All of row 2 should be red on second slide only
Row 2 & 2.345 & 2.345 \\


When I compile, I get a couple of errors like

! Misplaced \noalign.
\rowfont -&gt;\ifdim \baselineskip =\z@ \noalign
                                            \fi {\ifnum 0=`}\fi \tabu@row@...
l.28     \end{frame}

The output has two pages. The first page is correct, first row is highlighted (although the first column doesn't appear to be left-aligned). On the second page, the first row is highlighted as expected, but the second row only highlights the numbers, not the first column. Here is a screenshot:

Screenshot of output


1 Answer 1

  • Thank you, a nice simple solution. Based on this answer I was able to create a new command \newcommand<>{\highlighttext}{\only#1{\color{red}\dcolcolor{red}}}. Usage would be \rowfont{\highlighttext<1>} above a row. However, note that \newcommand<>{\highlightrow}{\rowfont{\only#1{\color{red}\dcolcolor{red}}}} with usage \highlightrow<1> doesn't work.
    – Clara
    Commented Aug 12, 2012 at 15:44

You must log in to answer this question.

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