节点位置问题

节点位置问题

为什么当我用替换 时,名为 的最后一个节点kap2没有改变其位置?[我想更改评论“Killing vectors”的位置]at (1,0)at (3,0)

我的 MWE:

  \documentclass{beamer}
    \usepackage{mathtools,tikz,lmodern, xparse}
    \usepackage{tensor}
    \usetikzlibrary{%arrows, chains, matrix, 
                positioning, 
                %shadows,
                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}

答案1

您必须添加覆盖键:

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

不要忘记编译两次!

\documentclass{beamer}
    \usepackage{mathtools,tikz,lmodern, xparse}
    \usepackage{tensor}
    \usetikzlibrary{%arrows, chains, matrix, 
                positioning, 
                %shadows,
                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}

相关内容