7

If I try to put two decorations on the same path, both at position 1, only the first shows up:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}
\begin{document}
 \begin{tikzpicture}
  \node (0)                     {};
  \node (1) [right       of=0]  {};
  \node (2) [below right of=1]  {};
  \path (0) edge[out=0, in=135, postaction={decorate,
   decoration={
    markings,
    mark=at position 1 with {\arrow[>=diamond, yellow] {>}; },
    mark=at position 1 with {\arrow[>=open diamond]    {>}; } } }] (2);
 \end{tikzpicture}
\end{document}

enter image description here

Via a hack (modifying one of the position to be very close, but not exactly equal to 1)...

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}
\begin{document}
 \begin{tikzpicture}
  \node (0)                     {};
  \node (1) [right       of=0]  {};
  \node (2) [below right of=1]  {};
  \path (0) edge[out=0, in=135, postaction={decorate,
   decoration={
    markings,
    mark=at position 0.999 with {\arrow[>=diamond, yellow] {>}; },
    mark=at position 1     with {\arrow[>=open diamond]    {>}; } } }] (2);
 \end{tikzpicture}
\end{document}

...I get the output I expected from for the first image:

enter image description here

I also get the expected result if the decorations are at the same point different from 1:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}
\begin{document}
 \begin{tikzpicture}
  \node (0)                     {};
  \node (1) [right       of=0]  {};
  \node (2) [below right of=1]  {};
  \path (0) edge[out=0, in=135, postaction={decorate,
   decoration={
    markings,
    mark=at position 0.5 with {\arrow[>=diamond, yellow] {>}; },
    mark=at position 0.5 with {\arrow[>=open diamond]    {>}; } } }] (2);
 \end{tikzpicture}
\end{document}

enter image description here

Question:

Why is this happening?

  • If you make both positions .99999 you get the correct output; if you add one more 9 to each, the bug reappears. – Alan Munn Apr 03 '12 at 02:33

2 Answers2

5

Update

Better than a workaround, you can draw the marks at the same time with

mark=at position 1 with {\arrow[>=diamond, yellow] {>};
                           \arrow[>=open diamond] {>};}

Complete code :

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}
\begin{document}
 \begin{tikzpicture}
  \node (0)                     {};
  \node (1) [right       of=0]  {};
  \node (2) [below right of=1]  {};
  \path (0) edge[out=0, in=135, 
   postaction={decorate,
    decoration={  
    markings,     
    mark=at position 1 with {\arrow[>=diamond, yellow] {>};\arrow[>=open diamond] {>};},
    }}] (2);
 \end{tikzpicture}
\end{document} 

A workaround

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}
\begin{document}
 \begin{tikzpicture}
  \node (0)                     {};
  \node (1) [right       of=0]  {};
  \node (2) [below right of=1]  {};
  \draw[postaction={decorate,
   decoration={
    markings,
    mark=at position 1 with {\arrow[>=diamond, yellow] {>}; }}}] (0) to [out=0, in=135] (2); 
  \path[postaction={decorate,
   decoration={
    markings,
    mark=at position 1 with {\arrow[>=open diamond]    {>};}}}] (0) to [out=0, in=135] (2); 
 \end{tikzpicture}
\end{document}

enter image description here

Alain Matthes
  • 95,075
1

I just had this problem again and my own hack I provided in my question didn't work. This is what did work:

mark=at position 0.999 with {\arrow[>=diamond, yellow] {>};
                             \arrow[>=open diamond]    {>};}

or

mark=at position 0.999 with {\arrow[>=diamond, yellow] {>};}
mark=at position 0.999 with {\arrow[>=open diamond]    {>};}

Basically, don't put either of them at 1. That must really be what the bug is.