Consider the following code:
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[corner/.pic = {
\path[pic actions] (0,0) -- (1,0) -- (0,1) --cycle;
}]
\pic[draw] {corner} ++(1,0) node{hi};
\end{tikzpicture}
\end{document}
This generates the following error:
I do not know the key '/tikz/pics/hi' and I am going to ignore it. Perhaps you misspelled it. \pic[draw] {corner} ++(1,0) node{hi}
It seems that TikZ interprets the node as a pic, and as a consequence tries to find the definition of a pic called hi instead of using hi as the text inside of the node.
By contrast, \node{hi} ++(1,0) pic[draw] {corner}; works as expected.
Why is this? How can I fix it?
\path {pic[draw] {corner}} ++(1,0) node {hi};– percusse Dec 15 '14 at 00:16\path pic[draw] {corner} ++(1,0) node[draw] {corner};is rendering the same as\path pic[draw] {corner} ++(1,0) pic[draw] {corner};. – TonioElGringo Dec 15 '14 at 09:27insert path=I'm not able to solve the problem this way (I use Mark Wibrow's trick in this case). – Kpym Dec 15 '14 at 12:26insert path, but I don't know for the moment how to draw a point on the foreground layer without it (and without hack) : http://tex.stackexchange.com/a/217798/9335 – Kpym Dec 15 '14 at 12:37