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 seem to have run into a strange interference between \includeonlyframes and use of \onslide to uncover a row in a tabular environment. Consider the following:

\documentclass{beamer}
\begin{document}
  \includeonlyframes{second}

  \begin{frame}{First frame}
    \begin{tabular}{rl}
      \onslide<+->{Some & text}
    \end{tabular}
  \end{frame}

  \begin{frame}[label=second]{Second frame}
    Some text on second frame
  \end{frame}
\end{document}

When I run pdflatex on this example, I get "Missing } inserted." Curiously, if I make any one of the following changes, then the example compiles successfully.

  • Remove the \includeonlyframes line.
  • Remove the \onslide<+->{ and } from around the tabular row.
  • Remove the tabular environment (and &), but leave \onslide<+->{ and }.
  • Replace \onslide<+->{ and } with the switch form \onslide<+->.
    That is, use \onslide<+-> Some & text.
  • Replace \onslide<+->{ and } with \uncover<+->{ and }.
    (It seems particularly strange that \uncover<+->{ works but \onslide<+->{ does not, especially considering the apparent equivalence discussed in Differences and best practices: \onslide vs. \uncover, \onslide+ vs. \visible, \onslide* vs. \only?.)
  • Label the first frame with the optional argument [label=first].

So, by doing either of the last three bullets, I can work around this problem and still retain the overlay behavior that I want. Nevertheless, I would like to understand why this error arises. Does anyone have any ideas?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

EDIT:

There is also bug report at bitbucket:

https://bitbucket.org/rivanvx/beamer/issue/204/onslide-failure-in-tabular-with


The problem is that every cell is a single group and you can use \onslide for one row. The ampersand bust be separated. The documentation of beamer has an extra section about slides and tabular. So the way to do is:

  \onslide<1->{Some} & \onslide<1->{text} \\

Here the complete mwe:

\documentclass{beamer}
\begin{document}
  \includeonlyframes{second}

  \begin{frame}{First frame}
    \begin{tabular}{rl}
      \onslide<1->{Some} & \onslide<1->{text} \\
    \end{tabular}
  \end{frame}

  \begin{frame}[label=second]{Second frame}
    Some text on second frame
  \end{frame}
\end{document}
share|improve this answer
    
But what is really surprising is that \onslide<+->{Some & text} works fine as long as \includeonlyframes{second} is not included! Do you have any idea why this would be the case? (The bug report that you linked to does not mention \includeonlyframes as far as I can see.) –  Henry DeYoung Aug 5 '12 at 17:28
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.