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.

For educational purposes, I would like to uncover the definitions of my description items only after all the items themselves have been uncovered, like so:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{overprint}
\begin{description}
\item<1->[Spam]
\onslide<3->{Eggs}
\item<2->[Cheese]
\onslide<4->{Tofu}
\end{description}
\end{overprint}
\end{frame}
\end{document}

However, this has the effect that both Spam and Eggs appear only on slide 3. I would like that in slide 1, I have Spam (but without any content), and in slide 3, I have Spam and Eggs. How can I achieve this?

An alternative would be to use a tabular environment, but I'm interested to see if it can be achieved with a description.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Something like this works:

\documentclass{beamer}

\newcommand\desctext[1]{%
  \only<+(1)>{\mbox{}}%
  \onslide<+(1)->{#1}}

\begin{document}

\begin{frame}
\begin{overprint}
\begin{description}
\addtocounter{beamerpauses}{-1}
\item[Spam1]\desctext{Eggs1}
\item[Spam2]\desctext{Eggs2}
\item[Spam3]\desctext{Eggs3}
\item[Spam4]\desctext{Eggs4}
\addtocounter{beamerpauses}{1}
\end{description}
\end{overprint}

\end{frame}

\end{document}

For the ordering required (all labels first, then all descriptions), something like this can be done:

\documentclass{beamer}

\newcommand\desctext[2][]{%
  \only<+(1)->{\mbox{}}%
  \onslide<#1->{#2}}

\begin{document}

\begin{frame}
\begin{overprint}
\begin{description}
\addtocounter{beamerpauses}{-1}
\item[Spam1]\desctext[5]{Eggs1}% add one to the number of items
\item[Spam2]\desctext[6]{Eggs2}
\item[Spam3]\desctext[7]{Eggs3}
\item[Spam4]\desctext[8]{Eggs4}
\addtocounter{beamerpauses}{1}
\end{description}
\end{overprint}
\end{frame}

\end{document}
share|improve this answer
    
Almost; in fact, I like to first have all the items appear, then all the descriptions. And I might want a finer-grained control in any case. But the \mbox{} does the trick to solve the problem. –  gerrit Oct 10 '12 at 17:15
    
@gerrit I updated my answer with a posibble definition for this new ordering; perhaps it can be simplified a little to elliminate the optional argument. –  Gonzalo Medina Oct 10 '12 at 17:29

Personally I use itemize environment to achieve your goal.

description environment seems to behave differently from itemize and enumerate environment for "complicated" constructions.

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{overprint}
\begin{itemize}
\item<1-> Spam:
\onslide<2->{Eggs}
\end{itemize}
\end{overprint}
\end{frame}
\end{document}
share|improve this answer

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.