# Nested overlayareas

I want to have a series of slides, where the upper half is constantly the same picture. I would normally use two overlayareas to split the slide, but at some point I'd like to subdivide the bottom half again, as follows.

Is there some way I can subdivide an overlayarea into more overlayareas from one slide to the next?

PS: Just splitting the size of the bottom overlayarea still seems to produce some wobbling of the upper half, as happens in this example:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{overlayarea}{\textwidth}{2cm}
A
\end{overlayarea}
\only<1>{
\begin{overlayarea}{\textwidth}{2cm}
B
\end{overlayarea}
}
\only<2>{
\begin{overlayarea}{\textwidth}{1cm}
C
\end{overlayarea}
\begin{overlayarea}{\textwidth}{1cm}
D
\end{overlayarea}
}
\end{frame}
\end{document}

• Perhaps simply put the [t] option after \begin{frame} to top-aligned the contents? This will solve the wobbling problem. Oct 8 '14 at 20:29

Maybe like this:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{overlayarea}{\textwidth}{.5\textheight}
\centering
\includegraphics[height=.5\textheight]{example-image-a}
\end{overlayarea}
\only<1>{
\begin{overlayarea}{\textwidth}{.5\textheight}
\centering
\includegraphics[height=.5\textheight]{example-image-b}
\end{overlayarea}
}
\only<2>{
\begin{overlayarea}{\textwidth}{.25\textheight}
\centering
\includegraphics[height=.25\textheight]{example-image-c}
\end{overlayarea}
\begin{overlayarea}{\textwidth}{.25\textheight}
\centering
\includegraphics[height=.25\textheight]{example-image-c}
\end{overlayarea}
}
\only<3>{
\begin{overlayarea}{\textwidth}{.25\textheight}
\centering
\includegraphics[height=.25\textheight]{example-image-a}
\end{overlayarea}
\begin{overlayarea}{\textwidth}{.25\textheight}
\centering
\includegraphics[height=.25\textheight]{example-image-b}
\end{overlayarea}
}
\end{frame}
\end{document}


## No wobbling

Just enclose everything into an overlay area whose height is equal to the sum of the inner areas and the wobbling will go away:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{overlayarea}{\textwidth}{4cm}       %new code
\begin{overlayarea}{\textwidth}{2cm}
A
\end{overlayarea}
\only<1>{
\begin{overlayarea}{\textwidth}{2cm}
B
\end{overlayarea}
}
\only<2>{
\begin{overlayarea}{\textwidth}{1cm}
C
\end{overlayarea}
\begin{overlayarea}{\textwidth}{1cm}
D
\end{overlayarea}
}
\end{overlayarea}    %new code
\end{frame}
\end{document}


• I tried that, but for some reason I still get some wobbling. In my case the "A" moves slightly upwards when going from the first to the second slide. That's why I wanted to fix the bottom half and subdivide it. But in your example it seems to work. Any idea why that might be so? Oct 8 '14 at 19:30
• uhm... I can't seem to reproduce your issue. Do you experience the issue when copy/pasting my MWE into a new file and compiling as it is, or when you try to adapt the code to your content? Oct 8 '14 at 19:33
• When I tried to adapt the code to my content. I am trying to just copy/paste your code, but I'm using lyx and don't know if I have the required figures. I am using a tikzpicture on the upper half and I'm subdividing the bottom half from 2.5cm to a 2cm and a 0.5cm area. Oct 8 '14 at 19:37
• The figures are distributed with the mwe package, so if you have the package you should have them too. If I use some random figures I still get the same result shown above. There must be something somewhere else in your code that causes the wobbling. Would it be possible for you to set up a mwe that shows the problem so that I can reproduce it? Oct 8 '14 at 19:41
• Excellent! It finally works. Oct 8 '14 at 20:39