테두리에 장식 마킹을 사용할 수 있나요?

테두리에 장식 마킹을 사용할 수 있나요?

초기 코드는

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations} 
\usetikzlibrary{decorations.markings}
\begin{document}

\pgfkeys{
/pgf/decoration/.cd,
pre fraction/.style={pre length=#1*\pgfmetadecoratedpathlength},
post fraction/.style={post length=#1*\pgfmetadecoratedpathlength}
}

\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (4,2);

\draw [  
decoration={ 
curveto,
pre=moveto, pre fraction=0,
post=moveto, post fraction=0.3}, decorate, red, ultra thick] (A) to[out=0,in=-90](B);

\draw [decoration={curveto,
                   pre=moveto, pre fraction=0.7,
                   post=moveto, post fraction=0},%
       decorate, blue, ultra thick,dotted] (A) to [out=0,in=-90](B); 

\path [  
decoration={ 
     markings, mark=at position .7  with {\arrow[red,line width=2pt]{>}}},  
     decorate  ] (A) to[out=0,in=-90](B);         
\end{tikzpicture} 

\end{document}

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

to로 교체하려고 하면 문제가 있습니다 edge. 어떤 경우에는 교체가 유용합니다.

edge로 제작이 가능한가요? 그리고 어떻게 ?

문제는 메인 경로를 그린 후 추가하는 연산 edge처럼 동작한다는 점에서 발생한다고 생각합니다. 빈 경로에서는 작동하지 않는 to오류가 자주 발생합니다 !marking

답변1

마침내 나는 여기서 답을 찾았습니다.texblog.net기사에서 :TikZ 경로 장식. (저자: Stefan Kottwitz 감사합니다!) 왜 더 일찍 생각하지 않았는지 모르겠습니다. 의 사용과 관련된 많은 질문 edge이 다음과 같이 해결될 수 있습니다. 예:TikZ 가장자리와 앵커가 있는 이상한 화살표 표시.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations} 
\usetikzlibrary{decorations.markings}
\begin{document}

\begin{tikzpicture}
  \tikzset{every loop/.style={min distance=20mm,in=0,out=60,looseness=10}} 

   \draw (0,0) node[circle,draw]{A} edge[red,loop]  ();    
 \path[decoration={ 
     markings, mark=at position .7  with {\arrow[blue,line width=1pt]{>}}}] (0,0) node[circle]{A} edge[decorate,loop]  ();
\end{tikzpicture}

\end{document}

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

관련 정보