我想显示项目,每个项目都有一条指向右图上某个点的曲线。但在以下代码中,曲线消失了。哪里出了问题?
\documentclass{beamer}
\usepackage{graphicx}
\usepackage{pst-node}
\newsavebox\IBox
\savebox\IBox{\includegraphics[scale=.5]{example-image-a}}
\psset{xunit=.1\wd\IBox,yunit=.1\ht\IBox,arrows=->,linecolor=red}
\begin{document}
\begin{frame}[t]{Hello World and Hello Universe}
\begin{columns}[t]
\begin{column}{.3\linewidth}
\begin{enumerate}
\item<2-> \rnode[r]{HWl}{Hello World}\nccurve{HWl}{HWr}
\item<3-> \rnode[r]{HUl}{Hello Universe}\nccurve{HUl}{HUr}
\end{enumerate}
\end{column}
\begin{column}{.7\linewidth}
\begin{center}
\begin{pspicture}[showgrid=top](10,10)
\rput[bl](0,0){\usebox\IBox}
\pnode(2,4){HWr}
\pnode(5,8){HUr}
\end{pspicture}
\end{center}
\end{column}
\end{columns}
\end{frame}
\end{document}
答案1
节点HWr
和HUr
仅在您命令后定义\nccurve
。您可以添加例如
\only<2>{\nccurve{HWl}{HWr}}
\only<3>{\nccurve{HUl}{HUr}}
定义所有节点后:
\documentclass{beamer}
\usepackage{graphicx}
\usepackage{pst-node}
\newsavebox\IBox
\savebox\IBox{\includegraphics[scale=.5]{example-image-a}}
\psset{xunit=.1\wd\IBox,yunit=.1\ht\IBox,arrows=->,linecolor=red}
\begin{document}
\begin{frame}[t]{Hello World and Hello Universe}
\begin{columns}[t]
\begin{column}{.3\linewidth}
\begin{enumerate}
\item<2-> \rnode[r]{HWl}{Hello World}\nccurve{HWl}{HWr}
\item<3-> \rnode[r]{HUl}{Hello Universe}\nccurve{HUl}{HUr}
\end{enumerate}
\end{column}
\begin{column}{.7\linewidth}
\begin{center}
\begin{pspicture}[showgrid=top](10,10)
\rput[bl](0,0){\usebox\IBox}
\pnode(2,4){HWr}
\pnode(5,8){HUr}
\only<2>{\nccurve{HWl}{HWr}}
\only<3>{\nccurve{HUl}{HUr}}
\end{pspicture}
\end{center}
\end{column}
\end{columns}
\end{frame}
\end{document}