tikz spy 与 beamer 叠印

tikz spy 与 beamer 叠印

在我的演示中,我想使用该库连续突出显示图像的不同部分TikZ spy。由于尺寸限制,实际突出显示在所包含图像之外。因此,我将beamersoverprint环境与 一起使用onslide。这对于 来说很有效\node,但我无法让它对 起作用\spy

下面是一个最小但不工作的示例。我在评论中描述了问题。

\documentclass[12pt]{beamer}
\usepackage{tikz}
\usetikzlibrary{spy}
\begin{document}
\begin{frame}
\begin{overprint}
\begin{tikzpicture}[spy using outlines={circle, blue, magnification=6, connect spies}]
% bluemarble from http://en.wikipedia.org/wiki/File:Apollo17WorldReversed.jpg
\node<1-> (image) at (0,0) {\includegraphics[width=6cm]{bluemarble}};
% this one compiles, but image jumps around
% \only<2->{\spy [size=3cm] on (1,1) in node at (4, 4);}
% this one fails to compile with: ! Extra }, or forgotten \endgroup.
% \onslide<2->\spy [size=3cm] on (1,1) in node at (4, 4);
% this one fails to compile with:
% Runaway argument?
% ]<2-> [size=3cm] on (1,1) in node at (4, 4); \end {tikzpicture} \end \ETC.
% ! Paragraph ended before \tikz@lib@spy@parse@opta was complete.
\spy<2-> [size=3cm] on (1,1) in node at (4, 4);
% these compile, but 'spy' is on every slide
% \onslide<2->{\spy [size=3cm] on (1,1) in node at (4, 4);}
% \uncover<2->{\spy [size=3cm] on (1,1) in node at (4, 4);}
\end{tikzpicture}
\end{overprint}
\end{frame}
\end{document}

beamer指南第 6.3.1 节,使命令和环境覆盖规范感知,但我不确定如何应用这个\renewcommand<>东西来\spy使它能够感知覆盖规范,因为\spy它看起来不像我用(re)newcommand 创建的“普通”命令。

如何使用\spy而不让我的图像“跳来跳去”,例如使用(最好是自动计算的)边界框对于不同的幻灯片保持不变?

答案1

您可以尝试将节点设为覆盖: \only<2->{\spy [size=3cm] on (1,1) in node[overlay] at (4, 4);} 这样您就根本不需要overprint环境了。覆盖节点意味着它不会添加到边界框中。

相关内容