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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For a presentation I want to show how an equation is simplified in steps. When I try to do this using \only, the text jumps around vertically.

Minimal failing example:

\documentclass[11pt]{beamer}
\begin{document}

\begin{frame}
\begin{itemize}
\item<1|only@1> Curvature term drops in 2d:
\begin{equation*}
S = \frac{1}{16 \pi G} \int d^{n}x \sqrt{-\det g} (R - 2 \Lambda)
\end{equation*}

\item<2|only@2> $\Lambda$ is constant:
\begin{equation*}
S = \frac{1}{16 \pi G} \int d^{n}x \sqrt{-\det g} (- 2 \Lambda)
\end{equation*}

\item<3|only@3> Rescale cosmological constant:
\begin{equation*}
S = \frac{-2\Lambda}{16 \pi G} \int d^{n}x \sqrt{-\det g}
\end{equation*}

\item<4|only@4> Integral over space:
\begin{equation*}
S = - \lambda \int d^{n}x \sqrt{-\det g}
\end{equation*}

\end{itemize}

\end{frame}

\end{document}

How can I fix this? Is there a better way to get a similar effect, without using \only?

share|improve this question
up vote 3 down vote accepted

This is what the overprint and overlayarea environments were designed for. In your case, you can use overlayarea and \leavevmode (the latter to prevent the initial "jump"):

\documentclass[11pt]{beamer}
\begin{document}

\begin{frame}
\begin{overlayarea}{\textwidth}{3cm}
\leavevmode
\begin{itemize}
\item<1|only@1>{Curvature term drops in 2d:
\begin{equation*}
S = \frac{1}{16 \pi G} \int d^{n}x \sqrt{-\det g} (R - 2 \Lambda)
\end{equation*}}

\item<2|only@2>{$\Lambda$ is constant:
\begin{equation*}
S = \frac{1}{16 \pi G} \int d^{n}x \sqrt{-\det g} (- 2 \Lambda)
\end{equation*}}

\item<3|only@3>{Rescale cosmological constant:
\begin{equation*}
S = \frac{-2\Lambda}{16 \pi G} \int d^{n}x \sqrt{-\det g}
\end{equation*}}

\item<4|only@4>{Integral over space:
\begin{equation*}
S = - \lambda \int d^{n}x \sqrt{-\det g}
\end{equation*}}
\end{itemize}
\end{overlayarea}
\end{frame}

\end{document}

enter image description here

share|improve this answer
    
Ops, I thought the title "vertically center itemize" was the problem he wanted to solve :D – domenico Jun 28 '13 at 17:10

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.