I have nodes of differing heights next to each other and would like to draw a path (arrows) between them. However, I would like the path to be horizontal all the way. I managed to achieve this between the first and second node in my example, but I don’t know how I could get the line between the second and third to be in the same line as the first arrow (as if all the arrows have been drawn in one long horizontal segmented line).
\documentclass[tikz,border=1mm]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[every node/.style=draw]
\node (a) {(\alpha)};
\node[right=of a,yshift=-2mm,minimum height=1cm] (b)
{(\beta)};
\node[right=of b,minimum height=1cm] (c) {(\gamma)};
\draw[->] (a) edge (a -| b.west) (b) edge (c);
% \draw[->] (a) edge (a -| b.west) (a -| b.east) edge (b -| c.west);
\end{tikzpicture}
\end{document}
(The commented line is one of my failed attempts.)
As a side question, what is the recommended way to format tikz code when keeping a (eg) 72 haracter line limit? Where should I break the line? Here are a few examples:
\node[something=foo,some other thing] (averylongnodename)
{Node text};
\node[%
something=foo, % <--+
some other thing % <--+--- This arrangement seems to work nice with a lot of keys
] (averylongnodename) {Node text};
\node[something foo,some other thing] (averylongnodename) {Node
text};
% etc
(These examples weren’t fitted for 72 characters and are for illustration only.)




->from the draw command setting it on theedges works, but using\draw[->]doesn’t? – bp99 Dec 04 '20 at 19:33\draw[->]and observe difference. Withevery edge/.style = {draw, -Straight Barb}is determined that every edge has arrowheadStraight Barb, so use of edges with\draw[->]confusetikz. – Zarko Dec 04 '20 at 20:01edgeit treated as a separate path. See https://tex.stackexchange.com/a/314306/24974 for a much more thorough explanation. You could also use\draw[->] (a) edge (a -| b.west) (a -| b.east) -- (a -| c.west);which would apply the arrowhead to theedgepart as well as the--part. – erik Dec 04 '20 at 20:17