# Problem with node position

Why the last node, named kap2, does not change its position when I replace at (1,0) by at (3,0)? [I want to change the position of the comment "Killing vectors"]

My MWE:

  \documentclass{beamer}
\usepackage{mathtools,tikz,lmodern, xparse}
\usepackage{tensor}
\usetikzlibrary{%arrows, chains, matrix,
positioning,
shapes, shapes.callouts,graphs, calc,
%shapes.geometric,
%shapes.misc
}

\tikzstyle{every picture}+=[remember picture]

\begin{document}

\begin{frame}{}
\begin{equation*}
g_{ik}(\phi)\partial_j\tikz[baseline=0.18cm,overlay] \node[name=kap] at (0.18,0.3){$\kappa^k$};\phantom{\kappa^k}
+g_{mj}(\phi)\partial_i\kappa^m+\kappa^n \partial_n g_{ij}(\phi)=0
\end{equation*}
\tikz  \node[draw,  right,name=kap2,rounded corners,  fill=red!20,align=left] at (1,0) {Killing vectors};
\tikz[overlay] \draw[red,->] (kap2) to (kap);
\end{frame}

\end{document}


You must add overlay key in :

 \tikz  \node[draw,  right,name=kap2,rounded corners, overlay,
fill=red!20,align=left] at (3,-2) {Killing vectors};


Don't forget to compile twice !

\documentclass{beamer}
\usepackage{mathtools,tikz,lmodern, xparse}
\usepackage{tensor}
\usetikzlibrary{%arrows, chains, matrix,
positioning,
shapes, shapes.callouts,graphs, calc,
%shapes.geometric,
%shapes.misc
}

\begin{document}

\tikzstyle{every picture}+=[remember picture,]

\begin{frame}{}
\begin{equation*}
g_{ik}(\phi)\partial_j\tikz[baseline=0.18cm,overlay] \node[name=kap] at (0.18,0.3){$\kappa^k$};\phantom{\kappa^k}
+g_{mj}(\phi)\partial_i\kappa^m+\kappa^n \partial_n g_{ij}(\phi)=0
\end{equation*}

\tikz  \node[draw,  right,name=kap2,rounded corners, overlay,
fill=red!20,align=left] at (3,-2) {Killing vectors};
\tikz[overlay] \draw[red,->] (kap2) to (kap);
\end{frame}

\end{document}

• Thank you for your answer. In, fact this solve the problem, but I found in the TikZ manual that the overlay option is obligatory only for the pictures that contain references to other pictures (as I did in the last \tikz)! Commented Jan 26, 2016 at 5:54
• flav, Can you please explain to me why overlay is obligatory here ? Commented Jan 27, 2016 at 9:20
• @MedVall I think that : overlay is need when you want to use the node in an another picture and you use it as the begin of the arrow (referring to section 16.13.1 of the 2.10 tikz version)
– flav
Commented Jan 27, 2016 at 9:33
• Ah, I did not realize that, thanks a lot @flav, Commented Jan 27, 2016 at 9:46