TransWikia.com

Show outline around overlayarea

TeX - LaTeX Asked on June 7, 2021

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.

One Answer

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
newififbeamer@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=#2relax
  beamer@animwd=#3relax
  setboxbeamer@areabox=vbox tobeamer@animwdbgroup
  strutbegin{minipage}[t]{beamer@animht}%
  % Make the minipage behave like the main part of the slide
  normalfont
  raggedright
  }
  {%
  end{minipage}endgrafvfil
  egroup
  wdbeamer@areabox=beamer@animht
  htbeamer@areabox=beamer@animwd
  dpbeamer@areabox=0pt %
  ifbeamer@show@overlayarea
   bgroupfboxsep=0ptrelax
   hspace*{-0.4pt}vspace*{-0.4pt}%
   fbox{boxbeamer@areabox}hspace*{-0.4pt}vspace*{-0.4pt}%
   egroup
  else
   boxbeamer@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.

Answered by user230294 on June 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP