1

Minumum Working Example

\nonstopmode
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}

\path (0, 0) node (a) {} (1, .2) node (b) {} (1, 1) node (c) {} (.2, 1) node (d) {} ;

\draw [red] (a) [fill] circle (.03) (b) [fill] circle (.03) (c) [fill] circle (.03) (d) [fill] circle (.03) ; \draw [red] (a) -- (b) -- (c) -- (d) -- cycle ; \draw [blue, shift={(2, 0)}] (0, 0) [fill] circle(.03) -- (1, .2) [fill] circle(.03) -- (1, 1) [fill] circle(.03) -- (.2, 1) [fill] circle(.03) -- (0, 0) ; \end{tikzpicture} \end{document}

enter image description here

As above, when specifying the nodes by their co-ordinates (blue) the lines reach the place but for the named nodes (in red) they do. Also, --cycle doesn't work with named nodes.

I suspect that it has something to do with node having a border or something. Anybody knows the exact reason for this behavior?

sigsegv
  • 583
  • 1
    Check the pgfmanual, sec. 17.11 "Connecting Nodes: Using Nodes as Coordinates". You might need path operation (0,0) coordinate or (0,0) node[coordinate] {}. – muzimuzhi Z Aug 28 '21 at 09:16
  • 1
    More info: the size of (0,0) node (a) {} is controlled by the default setting shape=rectangle, inner sep=.3333em. – muzimuzhi Z Aug 28 '21 at 09:23
  • You might find this helpful https://tex.stackexchange.com/q/81848/86 (and there are other useful quedtions linked to that one) – Andrew Stacey Aug 28 '21 at 10:17

1 Answers1

1

It works as expected. nodes has a minimum size, that you can see if you draw them. And lines between nodes stop at their borders being or not they drawn.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}

\path (0, 0) node[draw] (a) {} (1, .2) node[draw] (b) {} (1, 1) node[draw] (c) {} (.2, 1) node[draw] (d) {} ;

\draw [red] (a) [fill] circle (.03) (b) [fill] circle (.03) (c) [fill] circle (.03) (d) [fill] circle (.03) ; \draw [red] (a) -- (b) -- (c) -- (d) -- cycle ; \draw [blue, shift={(2, 0)}] (0, 0) node[circle, draw, fill, minimum size=1mm, inner sep=0pt] {} -- (1, .2) node[circle, draw, fill, minimum size=1mm, inner sep=0pt] {} -- (1, 1) node[circle, draw, fill, minimum size=1mm, inner sep=0pt] {} -- (.2, 1) node[circle, draw, fill, minimum size=1mm, inner sep=0pt] {} -- (0, 0) ; \end{tikzpicture} \end{document}

enter image description here

Ignasi
  • 136,588