I have the following diagram:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\newcommand\rad{.75}
\foreach \a/\r in {60/0, 0/3, 120/3, 240/3}{
\begin{scope}[shift={(\a:\r*\rad)}]
\draw(60+\a:\rad) node (A\a) {} circle (.5mm) [fill];
\draw(180+\a:\rad) node (B\a) {} circle (.5mm) [fill];
\draw(300+\a:\rad) node (C\a) {} circle (.5mm) [fill];
\end{scope}
}
\path[blue, thick, <->]
(A60) edge (B120)
(B60) edge (B240)
(C60) edge (B0)
(A0) edge [bend right] (C120)
(A120) edge [bend right] (C240)
(A240) edge [bend right] (C0);
\end{tikzpicture}
\end{document}
I want the blue edges to all have a strike-through, so I modified it with decorations:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\newcommand\rad{.75}
\foreach \a/\r in {60/0, 0/3, 120/3, 240/3}{
\begin{scope}[shift={(\a:\r*\rad)}]
\draw(60+\a:\rad) node (A\a) {} circle (.5mm) [fill];
\draw(180+\a:\rad) node (B\a) {} circle (.5mm) [fill];
\draw(300+\a:\rad) node (C\a) {} circle (.5mm) [fill];
\end{scope}
}
\path[blue, thick, <->, decoration={markings,mark=at position 0.5 with {\arrow{|}}}]
(A60) edge [decorate] (B120)
(B60) edge [decorate] (B240)
(C60) edge [decorate] (B0)
(A0) edge [decorate, bend right] (C120)
(A120) edge [decorate, bend right] (C240)
(A240) edge [decorate, bend right] (C0);
\end{tikzpicture}
\end{document}
Obviously I did something wrong here. The edges themselves disappear and the arrow tips are off. The one on the source side is gone and the other one has very weird positioning.
I tried a few other arrow types other than |, and tried only decorating some of the edges:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\newcommand\rad{.75}
\foreach \a/\r in {60/0, 0/3, 120/3, 240/3}{
\begin{scope}[shift={(\a:\r*\rad)}]
\draw(60+\a:\rad) node (A\a) {} circle (.5mm) [fill];
\draw(180+\a:\rad) node (B\a) {} circle (.5mm) [fill];
\draw(300+\a:\rad) node (C\a) {} circle (.5mm) [fill];
\end{scope}
}
\path[blue, thick, <->, decoration={markings,mark=at position 0.5 with {\arrow{><}}}]
(A60) edge [decorate] (B120)
(B60) edge [decorate] (B240)
(C60) edge (B0)
(A0) edge [bend right] (C120)
(A120) edge [bend right] (C240)
(A240) edge [decorate, bend right] (C0);
\end{tikzpicture}
\end{document}
So it seems that decorating with this causes the issue. However I see pretty similar code in places like here and here.
What have I done wrong here? How do I fix my decorations?




markingsdecoration replaces the path and only places the marking (and then PGF still draws an arrow tip at the end of the discarded path). Usepostaction=decorateinstead. – Qrrbrbirlbel Oct 09 '22 at 17:51postaction=decoratedoesn't work withedge. – Sriotchilism O'Zaic Oct 09 '22 at 17:54--. – Sriotchilism O'Zaic Oct 09 '22 at 18:11