[Tex/LaTex] How to draw an arrow to a specified position in a frame and write some notes on the another end of arrow

arrowsbeamertikz-arrows

I would like to make an arrow and write some notes as shown below
enter image description here

I tried with the following code

\documentclass{beamer} %
\usetheme{CambridgeUS}
\usepackage[latin1]{inputenc}
\usefonttheme{professionalfonts}
\usepackage{times}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{verbatim}
\usetikzlibrary{arrows,shapes}

\author{Author}
\title{Presentation title}

\begin{document}

\frame{
\ft{MATERIAL IN THE UNIVERSE}
\framesubtitle{Simulations need to account for the full cosmic matter-energy content}
\begin{block}{Main ingredients of the Universe:}
\begin{itemize}
\item Dark Energy \hspace{16.3 mm} $\Rightarrow $ expansion, $a(t)$
\item Dark Matter \hspace{16.3 mm} $\Rightarrow $ collisionless fluid, interacting \\ \hspace{68 mm} via gravity
\item Baryonic Matter (`gas') $\Rightarrow $ \tikz[baseline]{\node[fill=green!20,anchor=base] (t1){(magneto)hydrodynamic};},\\ \hspace{68 mm} self-gravity
\end{itemize}
\begin{itemize}[<+-| alert@+>]
    \item that is actually not enough, we need to include sub-resolution physics (cooling, star formation, feedback processes, ...) and we would like to have radiative transport as well
        \tikz[na] \node[coordinate] (n1) {};
\end{itemize}

\begin{tikzpicture}[overlay]
        \path[->]<3-> (n1) edge [out=0, in=-90] (t1);
\end{tikzpicture}

\end{block}
}
\end{document}

But it is giving me the following error

! Undefined control sequence. \beamer@doifinframe …gas')
$\Rightarrow $ \tikz [baseline]{\node [fill=gre… l.185 } The control
sequence at the end of the top line of your error message was never
\def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the
correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll
forget about whatever was undefined.

How can I solve this? What could be the problem? Is there any another easier method to do this?

Thanks

Best Answer

You have to use remember picture in the options of n1 and t1 like

\tikz[remember picture] \node[coordinate] (n1) {};

Code:

\documentclass{beamer} %
\usetheme{CambridgeUS}
\usepackage[latin1]{inputenc}
\usefonttheme{professionalfonts}
\usepackage{times}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{verbatim}
\usetikzlibrary{arrows,shapes}

\author{Author}
\title{Presentation title}

\begin{document}

\frame{
\frametitle{MATERIAL IN THE UNIVERSE}
\framesubtitle{Simulations need to account for the full cosmic matter-energy content}
\begin{block}{Main ingredients of the Universe:}
\begin{itemize}
\item Dark Energy \hspace{16.3 mm} $\Rightarrow $ expansion, $a(t)$
\item Dark Matter \hspace{16.3 mm} $\Rightarrow $ collisionless fluid, interacting \\ \hspace{68 mm} via gravity
\item Baryonic Matter (`gas') $\Rightarrow $ \tikz[baseline,remember picture]{\node[fill=green!20,anchor=base] (t1){(magneto)hydrodynamic};},\\ \hspace{68 mm} self-gravity
\end{itemize}
\begin{itemize}[<+-| alert@+>]
    \item that is actually not enough, we need to include sub-resolution physics (cooling, star formation, feedback processes, ...) and we would like to have radiative transport as well
        \tikz[remember picture] \node[coordinate] (n1) {};
\end{itemize}

\begin{tikzpicture}[remember picture,overlay]   %% use here too
        \path[draw=magenta,thick,->]<3-> ([yshift=2mm]n1.north) to [out=0, in=0,distance=1in] (t1.east);
\end{tikzpicture}

\end{block}
}
\end{document}

enter image description here

With tikzmark:

\documentclass{beamer} %
\usetheme{CambridgeUS}
\usepackage[latin1]{inputenc}
\usefonttheme{professionalfonts}
\usepackage{times}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{verbatim}
\usetikzlibrary{arrows,shapes}

\author{Author}
\title{Presentation title}

\newcommand{\tikzmark}[1]{\tikz[remember picture] \node[coordinate] (#1) {#1};}

\begin{document}

\frame{
\frametitle{MATERIAL IN THE UNIVERSE}
\framesubtitle{Simulations need to account for the full cosmic matter-energy content}
\begin{block}{Main ingredients of the Universe:}
\begin{itemize}
\item Dark Energy \hspace{16.3 mm} $\Rightarrow $ expansion, $a(t)$
\item Dark Matter \hspace{16.3 mm} $\Rightarrow $ collisionless fluid, interacting \\ \hspace{68 mm} via gravity
\item Baryonic Matter (`gas') $\Rightarrow $ \tikzmark{t1},\\ \hspace{68 mm} self-gravity
\end{itemize}
\begin{itemize}[<+-| alert@+>]
    \item that is actually not enough,\tikzmark{n1} we need to include sub-resolution physics (cooling, star formation, feedback processes, ...) and we would like to have radiative transport as well
\end{itemize}

\begin{tikzpicture}[remember picture,overlay]
        %\path[draw=magenta,thick,->]<3-> ([yshift=3mm]n1) to ++(0,3mm) to [out=0, in=0,distance=2.5in] (t1);
   \path[draw=magenta,thick,->]<3-> ([yshift=3mm]n1) -- (t1);
\end{tikzpicture}

\end{block}
}
\end{document}

enter image description here