我想让这些框和文本标签在一段时间后逐渐消失,因为这会导致图像中出现不必要的混乱。另外,我最终想将图像幻灯片作为投影仪演示的一部分。
\documentclass{standalone}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[
every pin edge/.style={thick,blue!50},pin distance=15mm,
cir/.style = {align=center,circle,fill=blue!50,minimum size=6pt,inner sep=0pt}]
\node[anchor=south west,inner sep=0] (image) at (0,0)
{\includegraphics[width=1\textwidth]{example-image-a}};
\begin{scope}
[
x={(image.south east)},
y={(image.north west)}
]
% \draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
% \foreach \x in {0,1,...,9} { \node [anchor=north,font=\tiny] at (\x/10,0) {0.\x}; }
% \foreach \y in {0,1,...,9} { \node [anchor=east,font=\tiny] at (0,\y/10) {0.\y}; }
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\only<2->
{
\node [cir,pin=20:{Standard}] at (0.55,0.75) {};
\draw[red,ultra thick,rounded corners] (0.315,0.5) rectangle (0.59,0.87);
}
\only<3->
{
\node [cir,pin=240:{Standard2}] at (0.45,0.25) {};
\draw[red,ultra thick,rounded corners] (0.3,0.02) rectangle (0.61,0.41);
}
\only<4->
{
\node [cir,pin=110:{ABCD}] at (0.16,0.45) {};
\draw[blue,ultra thick,rounded corners] (0.10,0.29) rectangle (0.28,0.6);
}
\only<5->
{
\node [cir,pin=60:\parbox{4cm}{EFGHI}] at (0.82,0.45) {};
\draw[blue,ultra thick,rounded corners] (0.7,0.29) rectangle (0.85,0.5);
}
\only<6->
{
\node [cir,pin=20:\parbox{4cm}{lorem}] at (0.65,0.15) {};
\draw[green,ultra thick,rounded corners] (0.6,0.12) rectangle (0.7,0.28);
}
\end{scope}
\end{scope}
\end{tikzpicture}
\end{document}`
答案1
您可以使用 来将方框逐帧放置\only<slide number>
。如果您不知道大型演示文稿中的幻灯片编号,但想逐张显示它们,请使用\only<+>
。就像
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{overprint}
\begin{tikzpicture}[
every pin edge/.style={thick,blue!50},pin distance=15mm,
cir/.style = {align=center,circle,fill=blue!50,minimum size=6pt,inner sep=0pt}]
\node[anchor=south west,inner sep=0] (image) at (0,0)
{\includegraphics[width=1\textwidth]{example-image-a}};
\begin{scope}
[
x={(image.south east)},
y={(image.north west)}
]
% \draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
% \foreach \x in {0,1,...,9} { \node [anchor=north,font=\tiny] at (\x/10,0) {0.\x}; }
% \foreach \y in {0,1,...,9} { \node [anchor=east,font=\tiny] at (0,\y/10) {0.\y}; }
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\only<+>
{
\begin{scope}[overlay]
\node [cir,pin=20:{Standard}] at (0.55,0.75) {};
\draw[red,ultra thick,rounded corners] (0.315,0.5) rectangle (0.59,0.87);
\end{scope}
}
\only<+>
{
\begin{scope}[overlay]
\node [cir,pin=240:{Standard2}] at (0.45,0.25) {};
\draw[red,ultra thick,rounded corners] (0.3,0.02) rectangle (0.61,0.41);
\end{scope}
}
\only<+>
{
\begin{scope}[overlay]
\node [cir,pin=110:{ABCD}] at (0.16,0.45) {};
\draw[blue,ultra thick,rounded corners] (0.10,0.29) rectangle (0.28,0.6);
\end{scope}
}
\only<+>
{
\begin{scope}[overlay]
\node [cir,pin=60:\parbox{4cm}{EFGHI}] at (0.82,0.45) {};
\draw[blue,ultra thick,rounded corners] (0.7,0.29) rectangle (0.85,0.5);
\end{scope}
}
\only<+>
{
\begin{scope}[overlay]
\node [cir,pin=20:\parbox{4cm}{lorem}] at (0.65,0.15) {};
\draw[green,ultra thick,rounded corners] (0.6,0.12) rectangle (0.7,0.28);
\end{scope}
}
\end{scope}
\end{scope}
\end{tikzpicture}
\end{overprint}
\end{frame}
\end{document}
我习惯于scope
覆盖标记,这样幻灯片就不会跳动。我遗漏了线条和节点的位置,需要进行更正。