장식으로 인해 선이 사라짐

장식으로 인해 선이 사라짐

다음 다이어그램이 있습니다.

\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}

산출

파란색 가장자리에 모두 취소선이 있기를 원하므로 장식으로 수정했습니다.

\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}

깨진 출력

분명히 여기서 뭔가 잘못했습니다. 가장자리 자체가 사라지고 화살표 끝이 꺼져 있습니다. 소스 측의 하나는 사라졌고 다른 하나의 위치는 매우 이상합니다.

이외의 몇 가지 다른 화살표 유형을 시도하고 |일부 가장자리만 장식해 보았습니다.

\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}

더 많은 깨진 출력

그래서 이것으로 꾸미는 것이 문제가 되는 것 같습니다. 그러나 나는 다음과 같은 곳에서 꽤 비슷한 코드를 봅니다.여기그리고여기.

내가 여기서 뭘 잘못했나요? 장식을 어떻게 고치나요?

답변1

그만큼수동 상태

장식은 입력 경로를 파괴합니다(특정 경우 제외, 나중에 자세히 설명). 즉, 경로의 위치를 ​​결정하기 위해 경로를 사용하지만 장식이 완료된 후에는 이 경로가 사라집니다. 일반적으로 postaction표시를 추가하려면 를 사용해야 합니다 .

(어떤 경우는 장식입니다 mark connection node.)

decorates를 으로 바꾸면 postaction=decorate원하는 것을 얻을 수 있기를 바랍니다.

그만큼| 완벽하게 중앙에 있지 않기 때문입니다.요점만 건드려야 할 것 같아. \arrow{><}의 (역방향) 끝이 <중간이 아닌 위치 0.5에 배치되어 있기 때문에 요청하면 비슷한 일이 발생합니다.

모든 가장자리를 장식하려면 다음 every edge스타일을 사용하십시오.

\path[…, decoration = {…}, every edge/.append style={postaction=decorate}] …;

나는 추가하지 않았습니다arrows.meta도서관코드에서는 이전 화살표가 더 이상 사용되지 않지만 문제와 해결 방법은 동일합니다.

암호

\documentclass[tikz]{standalone}
\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 [postaction=decorate] (B120)
  (B60)  edge [postaction=decorate] (B240)
  (C60)  edge (B0)
  (A0)   edge [bend right] (C120)
  (A120) edge [bend right] (C240)
  (A240) edge [postaction=decorate, bend right] (C0);
\end{tikzpicture}
\end{document}

산출

여기에 이미지 설명을 입력하세요

관련 정보