我无法追踪以下代码中的错误

我无法追踪以下代码中的错误
\begin{tikzpicture}
\draw (0,-1) coordinate (x); \draw (0,1) coordinate (y); \draw[fill]
(x) circle (1.5pt) node[below]{\small $x$}; \draw[fill] (y) circle
(1.5pt) node[above]{\small $y$};
\draw [thick,->] (x) .. controls +(180:1cm) and +(0,0) .. (-1,0) 
node[end,left] {$a$};
\draw [thick] (y) .. controls +(180:1cm) and +(0,0) .. (-1,0);
\draw [thick,->] (x) .. controls +(0:1cm) and +(0,0) .. (1,0) 
node[end,right] {$d$};;
\draw [thick] (y) .. controls +(0:1cm) and +(0,0) .. (1,0);
\draw [thick,->] (x) .. controls +(180:.4cm) and +(0,0) .. (-.4,0) 
node[end,left] {$b$};
\draw [thick] (y) .. controls +(180:.4cm) and +(0,0) .. (-.4,0);
\draw [thick,->] (x) .. controls +(0:.4cm) and +(0,0) .. (.4,0) 
node[end,right] {$c$};
\draw [thick] (y) .. controls +(0:.4cm) and +(0,0) .. (.4,0);
\end{tikzpicture}

答案1

错误原因可以通过以下方法解决CarLaTeX 的评论或通过node[at end,...]。但是(离题)您的图像可以用以下稍微短一点的方式绘制:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
                decorations.markings,
                quotes}

\begin{document}
\begin{tikzpicture}[
DL/.style = {% Decorated Line
             decoration={markings, mark=at position .5 with {\arrow{Straight Barb}},},
             postaction={decorate},
             },
dot/.style = {circle, fill, inner sep=1pt, outer sep=0pt},
every edge quotes/.style = {auto, inner sep=2pt, font=\scriptsize}
                    ]
\node (a) [dot] at (0,-1) {};
\node (b) [dot] at (0,+1) {};
\draw[DL] (a) to [out=150, in=210,"a"] (b);
\draw[DL] (a) to [out=105, in=255,"b"] (b);
\draw[DL] (a) to [out= 75, in=285,"c" '] (b);
\draw[DL] (a) to [out= 30, in=330,"d" '] (b);
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容