I think I just discovered (!) that coordinates names are global in tikz:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[black]
\draw(0,0) coordinate(alfa) -- (3,0) coordinate(beta);
\end{tikzpicture}
\begin{tikzpicture}[blue]
\draw (alfa) -- (beta);
\end{tikzpicture}
\begin{tikzpicture}[red]
\begin{scope}
\draw(1,0) coordinate(alfa) -- (2,0) coordinate(beta);
\end{scope}
\end{tikzpicture}
\begin{tikzpicture}[green]
\draw (alfa) -- (beta);
\end{tikzpicture}
\end{document}
...and I really expected
- an error in the second
tikzpicture(I am not usingremember picture!), and - a
(0,0)--(3,0)green line...
So,
am I correct that coordinate names are global to all
tikzpictures?As a bonus question, is it possible to create local coordinate names?


983we find this, and I quote:\pgfgetlastxy{macro for x}{macro for y} Since (x,y) coordinates are usually assigned globally, it is safe to use this command after path operations– AndréC Nov 11 '18 at 18:00name prefix- it's in the accepted answer! – Rmano Feb 13 '20 at 06:44