答案1
欢迎光临!类似这样的事吗?
\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[pics/arc/.style={code={
\draw (-0.1,0.15) to[out=0,in=0,looseness=3] (-0.1,-0.15);}}]
\draw[very thick,blue] (1,1) -- (0,0) pic[pos=0.5,sloped,allow upside down] {arc};
\end{tikzpicture}
\end{document}
您也可以使用例如decorations.markings
或,arrows.meta
但此处的解决方案不需要任何库。
附录:当然,你可以将其设置为可以传递给的样式edge
。我将其称为样式sunset
,你可以使用它,例如
\draw[very thick,blue] (1,1) edge[supset] (0,0);
完整示例:
\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[pics/supsetarc/.style={code={
\draw (-0.1,0.15) to[out=0,in=0,looseness=3] (-0.1,-0.15);}},
pics/subsetarc/.style={code={
\draw (0.1,0.15) to[out=180,in=180,looseness=3] (0.1,-0.15);}},
supset/.style={to path={(\tikztostart) --
pic[pos=0.5,sloped,allow upside down] {supsetarc} (\tikztotarget)}},
subset/.style={to path={(\tikztostart) --
pic[pos=0.5,sloped,allow upside down] {subsetarc} (\tikztotarget)}}]
\draw[very thick,blue] (1,1) edge[supset] (0,0);
\draw[very thick,blue] (2,1) edge[subset] (1,0);
\end{tikzpicture}
\end{document}