2

I want to make the outline of the zoom feature bigger in the first slide where I can click on it.

I use this minimal working example:

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

How can I make the outline double as broad and in the color of my "alert"?

Obviously I visited: Zooming in and highlighting part of picture

1 Answer 1

2

You could redefine the \beamer@framezoom macro. See the line I marked with % <- change here to change the colour and linewidth.

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

enter image description here

4
  • Oh, wow, thanks a lot! I had no idea, it would be "SO" hard. Thank you so much, worked like a charm! Commented Sep 9, 2023 at 10:01
  • @canIchangethis You're welcome! Commented Sep 9, 2023 at 11:13
  • @canIchangethis It's the mouse-trigger thing. As soon as you said that, I knew you needed a new question ;). Although you don't mention the hovering here?
    – cfr
    Commented Sep 9, 2023 at 15:40
  • maybe because I am not really sure how "hovering" would work - and in the end the box that turns yellow when I "hover" over it, is all I need for now :) but yeah would be nice to know for other folks opening the question. Commented Sep 11, 2023 at 9:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .