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 3 '12 at 2:33
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

  • Thanks! I like your updated workaround that only uses one "mark". Good idea. – Tyson Williams Apr 10 '12 at 13:00
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.