beamer framezoom:限制缩放帧到边框

beamer framezoom:限制缩放帧到边框

此示例取自 diabonas 的回答有没有办法让 \framezoom 达到我预期的效果?

\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}

如您所见,缩放后的帧显示的区域比未缩放帧中框出的区域更大。有没有办法只显示缩放帧中的框出区域?

答案1

您可以修补 beamer 以仅在剪切路径中包含指定区域:

\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}

在此处输入图片描述

相关内容