0

The description of the edge operation

\path ... edge[<options>] <nodes> (<coordinate>) ...

opens with the following explanation (p. 246, chapter 17 'Nodes and Edges' in the TikZ part of the manual):

The effect of the edge operation is that after the main path the following path is added to the picture:

\path[every edge, 〈options〉] (\tikztostart)〈path〉;

Here, 〈path〉 is the to path . Note that, unlike the path added by the to operation, the (\tikztostart) is added before the 〈path〉 (which is unnecessary for the to operation, since this coordinate is already part of the main path).

The \tikztostart is the last coordinate on the path just before the edge operation, just as for the node or to operations. However, there is one exception to this rule: If the edge operation is directly preceded by a node operation, then this just-declared node is the start coordinate (and not, as would normally be the case, the coordinate where this just-declared node is placed – a small, but subtle difference). In this regard, edge differs from both node and to.

I don't understand the "small, but subtle difference" mentioned in the last paragraph. How can a node be the coordinate of anything? A node is a node, and a coordinate is a coordinate, except when a node has the coordinate shape, but I don't think this is what is meant here. And if we interpret this occurrence of the word "node" as "the coordinate where the node is anchored", then what is the difference between this coordinate and "the coordinate where this just-declared node is placed"?

1

The coordinate where the node is placed is, by default, the center and this is the coordinate the path is constructed to and from. When an edge is used, the relevant border anchor is used as the coordinate.

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \path [draw] (0,0) -- ++(1,1) node [draw] {node on path} -- ++(1,1);
  \path [draw] (0,-2) ++(1,1) node [draw] {node before edge} edge ++(1,1) edge ++(-1,-1)  ;
\end{tikzpicture}
\end{document}

placements vs. border anchors

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.