2

This example was taken from diabonas answer to Is there a way to get \framezoom to do what I expected it would?

\documentclass{beamer}

\begin{document}

\begin{frame}<1>[label=zooms] \frametitle<1>{The \TeX{} logo}
\frametitle<2>{The letter ``T''} \frametitle<3>{The letter ``E''}
\frametitle<4>{The letter ``X''}
\framezoom<1><2>[border](0.1cm,0cm)(3.6cm,4cm)
\framezoom<1><3>[border](3.4cm,1.2cm)(2.7cm,4.1cm)
\framezoom<1><4>[border](5.7cm,0cm)(3.7cm,4cm) {\scalebox{15}{\TeX}\\}
\end{frame}

\againframe<2->[noframenumbering]{zooms}

\end{document}

As you can see, the zoomed frames show larger areas than the areas that were framed in the unzoomed frame. Is there a way to only display the framed areas in the zoomed frames?

3
  • Any news on this one? I have the same issue and it is a pity when trying to highlight certain parts of regression results.
    – hannes101
    Jul 17 '18 at 11:57
  • I think the important part is this sentence from the beamer user guide: "The aspect ratio is kept correct and the zoomed area will possibly show more than just the specified area if the aspect ratio of this area and the aspect ratio of the available text area do not agree." So if you make sure that the size of the boxes adhere to the aspect ratio of the slides it should be fine. Will provide an answer, when I've tested it. ctan.space-pro.be/tex-archive/macros/latex/contrib/beamer/doc/…
    – hannes101
    Jul 17 '18 at 13:53
  • 1
3
+50

You can patch beamer to only include the specified area in the clipping path:

\documentclass{beamer}
\usepackage{xpatch}

\makeatletter
\newif\ifbeamer@zoomclip
\define@key{beamerzoom}{clip}[true]{\csname beamer@zoomclip#1\endcsname}
\xpatchcmd\beamer@framezoom{\pgfpathrectangle}{%
  \beamer@zoomclipfalse
  \setkeys{beamerzoom}{#3}%
  \ifbeamer@zoomclip
    \pgftransformshift{\pgfpoint{(\@tempdimb-#6*\beamer@temp)/2}{(\@tempdimc-#7*\beamer@temp)/2}}%
    \@tempdimb=\dimexpr#6*\beamer@temp\relax
    \@tempdimc=\dimexpr#7*\beamer@temp\relax
  \fi
  \pgfpathrectangle}{}{\typeout{Failed to patch, clip will not be available}}
\makeatother

\begin{document}

\begin{frame}<1>[label=zooms] \frametitle<1>{The \TeX{} logo}
\frametitle<2>{The letter ``T''} \frametitle<3>{The letter ``E''}
\frametitle<4>{The letter ``X''}
\framezoom<1><2>[border,clip](0.1cm,0cm)(3.6cm,4cm)
\framezoom<1><3>[border,clip](3.4cm,1.2cm)(2.7cm,4.1cm)
\framezoom<1><4>[border,clip](5.7cm,0cm)(3.7cm,4cm) {\scalebox{15}{\TeX}\\}
\end{frame}

\againframe<2->[noframenumbering]{zooms}

\end{document}

enter image description here

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.