4

I want to show items, each with a curve pointing to a point on the right figure. But in the following code, the curves disappear. What is wrong?

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

enter image description here

4

The nodes HWr and HUr are defined only after you \nccurve commands. You can add e.g.

\only<2>{\nccurve{HWl}{HWr}}
\only<3>{\nccurve{HUl}{HUr}}

after you defined all nodes:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.