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 have 3 parts in a tabular, I want onslide1- to be always displayed. After 1 clic, I want only2 to be shown; after another clic, at the position of only2, I want only3- to replace only2 forever; after another clic, onslide4- will appear. The code is as follows:

\documentclass{beamer}
\usetheme{Boadilla}
\usepackage[frenchb]{babel}

\begin{document}

\begin{frame}
  \begin{tabular}{ll|ll}
    \onslide<1->{
      \\\hline onslide1- \\\hline
    }

    \onslide<2->{
    \only<2>{
      \\[-2.8ex]
      only2\\\vspace{3cm}\\only2
      \\\hline
    }%

    \only<3->{
      \\[-2.8ex]
      only3-\\\vspace{3cm}\\only3-
      \\\hline
    }}

    \onslide<4->{
      \\\hline onslide4- \\\hline
    }

  \end{tabular}
\end{frame}

The problem is when onslide1- is displayed in the very beginning, it doesn't leave the place for only2 or only3- which will appear later. I try to add a \onslide<2->, because normally \onslide reserve the place, but it doesn't work here... Does anyone know how to solve that?

PS: I realize that the following code, which is simpler than previous, has same problem:

\begin{frame}
\begin{tabular}{ll|ll}
  \onslide<1->{onslide1\\}
  \only<2>{only2\\}%
  \only<3->{only3-\\}
  \onslide<4->{onslide4-\\} 
\end{tabular}
\end{frame}

However, the following code doesn't have this problem. So it seems that it is due to the position of \\, but I do need \\\hline in the initial code.

\begin{frame}
\begin{tabular}{ll|ll}
  \onslide<1->{onslide1}\\
  \only<2>{only2}%
  \only<3->{only3-}\\
  \onslide<4->{onslide4-}\\ 
\end{tabular}
\end{frame}
share|improve this question
    
Do you know the command \phantom{}? –  Sigur Aug 22 '12 at 0:15
    
Yes I know... that may be an alternative if there is no solution of overlay... –  SoftTimur Aug 22 '12 at 0:36

2 Answers 2

up vote 2 down vote accepted

Use overlayarea:

\documentclass{beamer}
\usetheme{Boadilla}
\usepackage[frenchb]{babel}

\begin{document}

\begin{frame}
\begin{overlayarea}{7cm}{7cm}
\begin{tabular}{ll|ll}
    \onslide<1->{%
      \\\hline onslide1- \\\hline
    }
    \only<2>{%
      \\[-2.8ex]
      only2\\\vspace{3cm}\\only2
      \\\hline
    }%
    \only<3->{%
      \\[-2.8ex]
      only3-\\\vspace{3cm}\\only3-
      \\\hline
    }
    \onslide<4->{%
      \\\hline onslide4- \\\hline
    }
  \end{tabular}
\end{overlayarea}
\end{frame}

\end{document}

enter image description here

share|improve this answer

Try with \visible or \uncover instead of \only and \onslide.

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.