It is easy to produce a path between two nodes consisting of a single horizontal and a single vertical line (from the manual):
\begin{tikzpicture}
\draw (0,0) node(a) [draw] {A} (1,1) node(b) [draw] {B};
\draw (a.north) |- (b.west);
\draw[color=red] (a.east) -| (2,1.5) -| (b.north);
\end{tikzpicture}
However, what if I wanted the same short syntax to produce a path between (a) and (b) using a horizontal line, a vertical line, and a second horizontal line. It isn't to difficult to calculate the intermediate points, but how could the following syntax be defined?
\begin{tikzpicture}
\draw (0,0) node(a) [draw] {A} (3,1) node(b) [draw] {B};
\draw (a.east) -|- (b.west);
\end{tikzpicture}
Best Answer
This answer extends Marc van Dongen's anwser.
The two styles are
-|-
and|-|
with default value0.5
to position the intermediate point (so, default is middle point).