Often, when drawing diagrams with TikZ, I’d like link nodes by edges just as I draw them. But when doing it the naive way, e.g.
\draw (0,0) node {A} -- (1,0) node {B};
the line intersects with the node labels. I get the desired result by drawing the edge after the nodes:
\path (0,0) node (A) {A} (1,0) node (B) {B};
\draw (A) -- (B);
But for that, I have to hand out names to the nodes. Is it possible to obtain that result in one \draw
command, without using names? Preferably a solution less involved than the chain library.
\draw (0,0) node [fill=white] {A} -- (1,0) node [fill=white] {B};
removes the intersection problem, but I don't know if the output is exactly the same as your second example.