2

While modifying this answer for my own use, I encountered something unexpected. In my experience, using \draw (1) -- (2) is equivalent to \path (1) edge (2). However, adding the option to draw or edge suggested in the linked answer gives different outcomes:

enter image description here

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}

\tikzset{
 ->-/.style={
  decoration={
   markings,
   mark=at position 0.5 with {\arrow[xshift=1.4pt]{angle 90}, \node[below] {+};}
  },
  postaction={decorate}
 }
}

\begin{document}
\begin{tikzpicture}
 \node (1) {};
 \node (2) [right of=1] {};
 \draw[->-] (1) -- (2);

 \node (3) [below of=1] {};
 \node (4) [right of=3] {};
 \path (3) edge[->-] (4);
\end{tikzpicture}
\end{document}

Question

What is the reason for this different behavior?

0 Answers0