Example: Global nodes

Published 2006-11-08 | Author: Kjell Magne Fauske

With version 1.09 or later of PGF/TikZ, it is possible to access nodes in other pictures. This is a very useful feature for presentations, posters and such. The catch is that it only works with pdfTeX and requires you to run TeX twice.

Author: Kjell Magne Fauske

Download as: [PDF] [TEX]

Global nodes

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de. En français: TeXnique.fr.



% For every picture that defines or uses external nodes, you'll have to
% apply the 'remember picture' style. To avoid some typing, we'll apply
% the style to all pictures.
\tikzstyle{every picture}+=[remember picture]

% By default all math in TikZ nodes are set in inline mode. Change this to
% displaystyle so that we don't get small fractions.

    \item Coriolis acceleration
        \tikz\node [fill=blue!20,draw,circle] (n1) {};

% Below we mix an ordinary equation with TikZ nodes. Note that we have to
% adjust the baseline of the nodes to get proper alignment with the rest of
% the equation.
\vec{a}_p = \vec{a}_o+\frac{{}^bd^2}{dt^2}\vec{r} +
            \node[fill=blue!20,anchor=base] (t1)
            {$ 2\vec{\omega}_{ib}\times\frac{{}^bd}{dt}\vec{r}$};
        } +
            \node[fill=red!20,anchor=base] (t2)
        } +
            \node[fill=green!20,anchor=base] (t3)

    \item Transversal acceleration
        \tikz\node [fill=red!20,draw,circle] (n2) {};
    \item Centripetal acceleration
        \tikz\node [fill=green!20,draw,circle] (n3) {};

% Now it's time to draw some edges between the global nodes. Note that we
% have to apply the 'overlay' style.
        \path[->] (n1) edge [bend left] (t1);
        \path[->] (n2) edge [bend right] (t2);
        \path[->] (n3) edge [out=0, in=-90] (t3);



Adding comments is currently not enabled.