2

When using beamer, is there a way to show an outline around an overlayarea to more quickly determine the correct height? If not, what is the advised way to determine the correct height to set? My current method is trial and error and seeing if it looks centered by eye.

4

Yes, you can add this. This is a somewhat more sophisticated version in which can be switched on and off by, well, a switch.

\documentclass{beamer}
\makeatletter
\newif\ifbeamer@show@overlayarea
\pgfkeys{/beamer/overlayarea/.cd,show frame/.is if=beamer@show@overlayarea,
show frame/.default=true}
\beamer@show@overlayareafalse
\mode
<presentation>
{\renewenvironment{overlayarea}[3][]{%
  \pgfkeys{/beamer/overlayarea/.cd,#1}%
  \beamer@animht=#2\relax
  \beamer@animwd=#3\relax
  \setbox\beamer@areabox=\vbox to\beamer@animwd\bgroup
  \strut\begin{minipage}[t]{\beamer@animht}%
  % Make the minipage behave like the main part of the slide
  \normalfont
  \raggedright
  }
  {%
  \end{minipage}\endgraf\vfil
  \egroup
  \wd\beamer@areabox=\beamer@animht
  \ht\beamer@areabox=\beamer@animwd
  \dp\beamer@areabox=0pt %
  \ifbeamer@show@overlayarea
   \bgroup\fboxsep=0pt\relax
   \hspace*{-0.4pt}\vspace*{-0.4pt}%
   \fbox{\box\beamer@areabox}\hspace*{-0.4pt}\vspace*{-0.4pt}%
   \egroup
  \else
   \box\beamer@areabox
  \fi 
}}
\makeatother
\begin{document}
\begin{frame}[t]
\frametitle{W/o show}
\begin{overlayarea}{\textwidth}{3cm}
      \only<1>{Some text for the first slide.\\Possibly several lines long.}
      \only<2>{Replacement on the second slide.}
\end{overlayarea}
\end{frame}

\begin{frame}[t]
\frametitle{W/ show}
\begin{overlayarea}[show frame]{\textwidth}{3cm}
      \only<1>{Some text for the first slide.\\Possibly several lines long.}
      \only<2>{Replacement on the second slide.}
\end{overlayarea}
\end{frame}
\end{document}

enter image description here

If you want to switch the frame on for all the overlayareas (except for those for which you say show frame=false), you can use

\pgfkeys{/beamer/overlayarea/show frame=true}

at some point in your document after which this change takes place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.