我想用 LaTeX 画一些类似的东西。我知道如何绘制两个直箭头,但我该如何绘制底部的异形箭头?
答案1
有点像这样。特别是,角度 30 可以根据需要进行更改。
\draw[->,>=stealth] (a) edge[bend right=zz]node[below]{C} (c);
\draw[->,>=stealth] (a) edge[out=xx, in=yy]node[below]{C} (c);
代码
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{positioning,arrows}
\begin{document}
\begin{tikzpicture}
\node at (0,0) (a) {a};
\node[right =1cm of a] (b){b};
\node[right =1cm of b] (c){c};
\draw[->,>=stealth] (a) --node[above]{A} (b);
\draw[->,>=stealth] (b) --node[above]{B} (c);
\draw[->,>=stealth] (a) edge[bend right=30]node[below]{C} (c);
\end{tikzpicture}
\end{document}
答案2
使用强大的tikz-cd
是一行代码:
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
a\ar[r,"A"]\ar[rr,out=-30,in=210,swap,"C"] & b\ar[r,"B"] & c
\end{tikzcd}
\end{document}
另一个选择是使用TikZ 中的graphs
和quotes
库,如亨利·孟克:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs,quotes}
\begin{document}
\tikz \graph[multi] {a->["A"] b ->["B"] c; a->[bend right,"C" below] c; };
\end{document}
答案3
运行xelatex
\documentclass{article}
\usepackage{pst-node}
\psset{shortput=nab,arrows=->,nodesep=2pt}
\begin{document}
\Rnode{a}{a}\qquad\Rnode{b}{b}\qquad\Rnode{c}{c}
\ncline{a}{b}^{A}\ncline{b}{c}^{B}
\nccurve[angleA=-45,angleB=225]{a}{c}_{C}
\end{document}
答案4
MetaPost 解决方案利用盒子包。显然,比蒂克兹和普斯特里克解决方案,但同样有效。使用 LuaLaTeX 运行。
\documentclass{standalone}
\usepackage{luamplib}
\mplibsetformat{metafun}
\mplibtextextlabel{enable}
\begin{document}
\begin{mplibcode}
input boxes;
u := 2cm;
beginfig(1);
boxjoin(a.e + (u, 0) = b.w;);
boxit.a("$a$"); drawunboxed(a);
boxit.b("$b$"); drawunboxed(b);
boxit.c("$c$"); drawunboxed(c);
path ab, bc, ac;
ab = a.e -- b.w; drawarrow ab; label.top("$A$", point 0.5 of ab);
bc = b.e -- c.w; drawarrow bc; label.top("$B$", point 0.5 of bc);
ac = a.se .. c.sw{dir 30}; drawarrow ac; label.bot("$C$", point 0.5 of ac);
setbounds currentpicture to boundingbox currentpicture enlarged 3bp;
endfig;
\end{mplibcode}
\end{document}