答案1
从所展示的示例,应该可以直接构建所讨论的其他图像。基础是使用 TikZ 库的路径装饰decorations.markings
,用它在线的中间绘制箭头。箭头处的文本是使用 TikZ 库设置的quotes
。您可以使用标准节点(未在下面的 MWE 中显示)来代替它:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{decorations.markings, quotes}
\begin{document}
\begin{tikzpicture}[decoration = {markings,
mark=at position 0.5 with {\arrow[thick]{>}}
},
C/.style = {circle, draw, minimum size=1.2em,inner sep=2pt}
]
\draw[postaction={decorate}] (0,0) -- (2,0);
\draw[postaction={decorate}] (0,1) to["$A$"] (2,1);
\draw[postaction={decorate}] (0,1) to["$A$"] (2,3);
%
\draw[postaction={decorate}] (0,-1) to["$A$"] ++ (2,0) node (a) [C,right] {$f_1$};
\draw[postaction={decorate}] (a) to["$B$"] ++ (2,0);
\end{tikzpicture}
\end{document}