I am trying to access a node defined inside a pic definition outside its scope. I found this example in the PGF manual v3.0.1a on page 254. The example given is as follows.
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\tikzset{
seagull/.pic={
% Code for a "seagull". Do you see it?...
\coordinate (-left wing) at (-3mm,0);
\coordinate (-head) at (0,0);
\coordinate (-right wing) at (3mm,0);
\draw (-left wing) to [bend left] (0,0) (-head) to [bend left] (-right wing);
}
}
\tikz {
\pic (Emma) {seagull};
\pic (Alexandra) at (0,1) {seagull};
\draw (Emma-left wing) -- (Alexandra-right wing);
}
\end{document}
But I get an error on compiling:
No shape named EmmaEmma-leftwing is known. Does anyone know what's wrong in this code and how one can access nodes defined inside a pic outside their scope.
\draw (-3mm,0) coordinate (-left wing) to [bend left] (0,0) coordinate (-head) to [bend left] (3mm,0) coordinate (-right wing);– Torbjørn T. Jun 18 '17 at 11:05pic, it works. Edit: In other words:seagull/.pic={ \draw (-3mm,0) coordinate (-left wing) to [bend left] (0,0) coordinate (-head) to [bend left] (3mm,0) coordinate (-right wing); }– Torbjørn T. Jun 19 '17 at 21:27