答案1
概念验证示例,请参阅
- v0.9f用户手册
tikz-cd
,第 3.1 节“调整to
路径”和 - pgfmanual v3.1.8b,第 14.13 节“至路径操作”。
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A & B \arrow[dl,
to path={ |- ([shift={(3ex,2ex)}] \tikztostart.north)
|- ([shift={(0, -2ex)}] \tikztotarget.south)
-- (\tikztotarget)
}] \\
C & D
\end{tikzcd}
\end{document}
答案2
为了好玩,它非常简单pstricks
:
\documentclass{article}
\usepackage{pst-node}
\begin{document}
\[ \begin{psmatrix}[colsep=1.7cm]
[name=A] A & [name=B] B \\
[name=C] C & [name=D] D
\end{psmatrix}
\psset{linewidth=0.6pt, arrows=->, arrowinset=0.12, labelsep=1pt, nodesep=2pt}
\ncline{A}{B}\naput{f} \ncline{A}{C}\nbput{g}
\ncline{B}{D}\naput{h} \ncline{C}{D}\nbput{k}
\ncloop[angleA=90, angleB=-90, loopsize=0.6, linearc=0.1]{B}{C}
\]
\end{document}