到目前为止我一直在编写这个代码:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
\path
node (A) {$A$}
(0:4cm) node (B) {$B$}
(-60:4cm) node (C) {$C$};
\path[-stealth]
(A) edge [bend right] node [left] {} (C)
(C) edge node [right] {} (A)
(B) edge node [right] {} (C)
(C) edge [bend right] node [left] {} (B)
([yshift=-2.5pt]A.east) edge node [above,yshift= 1.0ex] {} ([yshift=-2.5pt]B.west)
([yshift= 2.5pt]B.west) edge node [below,yshift=-1.0ex] {} ([yshift= 2.5pt]A.east);
\end{tikzpicture}
\end{document}
但是,我需要一些划线箭头,例如从 C 到 B、从 C 到 A 以及从 A 到 B。我该如何制作它们?另外,如果可能的话,我可以在那里制作直箭头而不是弯曲的箭头吗?谢谢!
答案1
你可以将节点的度锚与这方法。像这样:
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{decorations.markings}
\tikzset{every node/.style={circle},
strike through/.append style={
decoration={markings, mark=at position 0.5 with {
\draw[-] ++ (-2pt,-2pt) -- (2pt,2pt);}
},postaction={decorate}}
}
\begin{document}
\begin{tikzpicture}
\path node (A) {$A$}
(0:4cm) node (B) {$B$}
(-60:4cm) node (C) {$C$};
\path[-stealth]
(A.315) edge [strike through] (C.105)
(C.135) edge (A.285)
(B.255) edge (C.45)
(C.75) edge [strike through] (B.225)
(B.165) edge (A.15)
(A.345) edge [strike through] (B.195);
\end{tikzpicture}
\end{document}
答案2
像这样?
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows, positioning}
\begin{document}
\begin{tikzpicture}[
node distance = 34mm and 17mm
]
\node (A) {$A$};
\node (C) [below right=of A] {$C$};
\node (B) [above right=of C] {$C$};
\path[-stealth]
(A) edge [bend right] (C)
(C) edge node[sloped] {$|$} (A)
(B) edge [bend left] (C)
(C) edge node[sloped] {$|$} (B)
([yshift=-2.5pt] A.east) edge ([yshift=-2.5pt] B.west)
([yshift= 2.5pt] B.west) edge ([yshift= 2.5pt] A.east);
\end{tikzpicture}
\end{document}