When I compile the following code
\documentclass[tikz]{standalone}
\usepackage{luatex85}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usetikzlibrary{quotes}
\usetikzlibrary{shadows}
\begin{document}
\begin{tikzpicture}[
rect/.style={rectangle},
sum/.style={draw,circle,minimum width=0.2cm,minimum height=0.2cm,fill=white,drop shadow={shadow xshift=.3ex,shadow yshift=-.3ex}},
dot/.style={fill,circle,inner sep=1pt,outer sep=0pt},
pics/integrator/.style args={#1 and #2}{
code={
\node[sum] (-in) {};
\node[dot,right=1.5*\a of -in.center,"above:#2"] (-out) {};
\node[rect,below=0.5*\a of $(-in.center)!0.5!(-out.center)$,
"left:#1"{font=\scriptsize,yshift=-0.25cm}] (-int) {$z^{-1}$};
\draw (-in.center) -- (-out.center);
\draw[-latex] (-int.center) -| (-in.center);
\draw[-latex] (-out.center) |- (-int.center);
}
}
]
\def\a{1cm}
\pic (int) {integrator=$x_1(k)$ and $B_{coil}$};
\end{tikzpicture}
\end{document}
with the lualatex compiler I get a strange error message:
! Package pgf Error: No shape named intcurrent path bounding box is known.
l.29 ...c (int) {integrator=$x_1(k)$ and $B_{coil}$};
When I remove the name prefix everything compiles fine.
Edit: I tried the workaround from the linked questions, by adding .center to every node, but that gives me the same error message as before. I also tested the passing of the name to the pic and resetting the name prefix inside the draw command. Also the same error persists.
\def\a{1cm}outside the picture! – cfr Aug 10 '17 at 13:24\def\aoutside the picture, you will overwrite any existing macro\awith no warning. If you want it to be global, use\newcommandor, better,\newlengthand\setlength. If you want to set\aregardless, do it in thetikzpictureso it doesn't affect your entire document.\def\<single letter>is very, very likely to be overwriting something LaTeX or TeX has already defined and\defdoes no checking whatsoever. Stuff will just break. – cfr Aug 10 '17 at 23:161.5*\a{} ofas the\awill gobble the following space. – cfr Aug 10 '17 at 23:23