我想在第一张幻灯片中放大缩放功能的轮廓,以便我可以单击它。
我使用这个最小的工作示例:
\documentclass{beamer}
\begin{document}
\begin{frame}
\framezoom<1><2>[border](0.5cm,0.5cm)(2cm,1.5cm)
\pgfimage[height=6cm]{example-grid-100x100bp.pdf}
\end{frame}
\end{document}
我怎样才能使轮廓的宽度加倍,并且颜色与我的“警报”一样?
显然我访问过:放大并突出显示图片的一部分
答案1
您可以重新定义\beamer@framezoom
宏。请参阅我标记的行以% <- change here
更改颜色和线宽。
\documentclass{beamer}
\makeatletter
\def\beamer@framezoom<#1><#2>[#3](#4,#5)(#6,#7){%
\par\nointerlineskip%
\global\beamer@slidehaszoomtrue%
\advance\beamer@zoomcount by1\relax%
\def\beamer@zoomborderwidth{0}%
\edef\beamer@labelzoomed{beamer@labelzoomed@\the\beamer@zoomframecount @\the\beamer@zoomcount}%
\setkeys{beamerzoom}{#3}%
\only<#1>{%
{\hypersetup{pdfhighlight={/P},allbordercolors=alerted text.fg,pdfborder={0 0 3}}% <- change here
\global\setbox\@tempboxa=\vbox{\hyperlink{\beamer@labelzoomed}{%
\expandafter\ifx\csname XeTeXrevision\endcsname\relax%
\else%
\special{pdf:xann width #6 height #7 depth 0pt}%
\fi%
\vbox to #7{%
\hbox to#6{\hfil}%
\vfil%
}%
}}}%
\ht\@tempboxa=0pt%
\wd\@tempboxa=0pt%
\dp\@tempboxa=0pt%
\setbox\@tempboxa=\vbox{\moveright#4\hbox{\lower#5\vbox{\box\@tempboxa}}}%
\ht\@tempboxa=0pt%
\wd\@tempboxa=0pt%
\dp\@tempboxa=0pt%
\global\setbox\beamer@zoombox=\vbox to0pt{\unvbox\beamer@zoombox\box\@tempboxa}%
}%
\only<#2>{%
\@ifundefined{\beamer@labelzoomed}%
{%
\hypertarget{\beamer@labelzoomed}{}%
\expandafter\gdef\csname\beamer@labelzoomed\endcsname{}%
}{}%
\gdef\beamer@zoomer{%
% compute zoom factor
\@tempdima=\beamer@frametextheight%
\@tempdimb=#7\relax%
\@tempcnta=\@tempdimb%
\divide\@tempcnta by4096\relax%
\multiply\@tempdima by16\relax%
\divide\@tempdima by\@tempcnta%
\@tempdimb=\paperwidth%
\ifbeamer@plainframe%
\else%
\advance\@tempdimb by-\beamer@leftsidebar%
\advance\@tempdimb by-\beamer@rightsidebar\relax%
\fi%
\@tempdimc=#6\relax%
\@tempcntb=\@tempdimc%
\divide\@tempcntb by4096\relax%
\multiply\@tempdimb by16\relax%
\divide\@tempdimb by\@tempcntb%
\ifdim\@tempdimb<\@tempdima%
\@tempdima=\@tempdimb%
\fi%
\edef\beamer@temp{\strip@pt\@tempdima}%
\@tempdimc=\beamer@frametextheight%
\advance\@tempdimc by4pt%
\@tempdimb=\paperwidth%
\ifbeamer@plainframe%
\else%
\advance\@tempdimb by-\beamer@leftsidebar%
\advance\@tempdimb by-\beamer@rightsidebar\relax%
\fi%
\setbox\@tempboxa=\vbox{\hsize=\@tempdimb\Acrobatmenu{GoBack}{\vbox to
\beamer@frametextheight{\hbox to\@tempdimb{\hfil}\vfil}}}%
\ht\@tempboxa=0pt%
\wd\@tempboxa=0pt%
\dp\@tempboxa=0pt%
\setbox\beamer@framebox=\vbox to\beamer@frametextheight{{%
\ifbeamer@plainframe\beamer@leftmargin=\Gm@lmargin\fi%
\begin{pgfpicture}{\beamer@leftmargin}{-\beamer@frametextheight}{\beamer@leftmargin}{0pt}
\pgftext[left,top]{\box\@tempboxa}
\pgfpathrectangle{\pgfpoint{0pt}{-\@tempdimc}}{\pgfpoint{\@tempdimb}{\@tempdimc}}%
\pgfusepath{clip}
\begingroup
\pgftransformscale{\beamer@temp}
\@tempdima=#4\relax%
\@tempdimb=#5\relax%
{\pgftransformshift{\pgfpoint{-\@tempdima}{\@tempdimb}}%
\pgftext[left,top]{\vbox{\vbox{}\nointerlineskip\unvbox\beamer@framebox}}}
\endgroup
\end{pgfpicture}%
}}%
\setbox\beamer@framebox=\vbox{%
\nobreak\vbox{}\nobreak\par\nobreak\beamer@entrycode\nobreak%
\nointerlineskip\unvbox\beamer@frametitlebox%
\nobreak%
\box\beamer@framebox%
\nobreak%
\vss%
\beamer@exitcode%
}%
\global\setbox\beamer@footins=\box\voidb@x% no footnotes in zoomed slides
}%
}%
}
\makeatother
\begin{document}
\begin{frame}
\framezoom<1><2>[border](0.5cm,0.5cm)(2cm,1.5cm)
\pgfimage[height=6cm]{example-grid-100x100bp.pdf}
\end{frame}
\end{document}