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?

closed as off-topic by Paul Gessler, Masroor, ChrisS, Jesse, Mico Jan 24 '15 at 6:37

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • I get the same output in each case here. In general, though, aren't edges supposed to be different in that they are constructed after the main path rather than as part of it? – cfr Jul 25 '14 at 20:44
  • Which answer is that? And I also don't get any difference. Must be some global option interfering. And edges are to paths not lines. – percusse Jul 25 '14 at 20:55
  • @percusse Oh, yes, sorry. Added the missing link. – Tyson Williams Jul 25 '14 at 21:02
  • 3
    I'm voting to close this question as off-topic because the problem is not reproducible with a current TeX distribution. – Paul Gessler Jan 24 '15 at 4:34
  • 1
    @TysonWilliams, at the present time, TeX Live 2014, MikTeX 2.9, or MacTeX-2014 with all packages updated using the chosen distribution's package manager. – Paul Gessler Jan 24 '15 at 14:31

Browse other questions tagged or ask your own question.