我尝试绘制这种形式的交换图:
代码和链接https://tikzcd.yichuanshen.de/是这一个:
\begin{tikzcd} u_i \arrow["?"', loop, distance=2em, in=125, out=55] \arrow[rr, "{(g^{-1}u_i,g^{-1})}", bend left, shift left] & & g^{-1}u_ig \arrow[ll, "{(u_i g,g)}", bend left] \arrow["{(u,v)}"', loop, distance=2em, in=125, out=55] \end{tikzcd}
然而,当我将此代码插入 Overleaf 时,它会生成此带有偏移箭头标签的图片:
我究竟做错了什么?
答案1
%<--
我已在代码中标记了更改。
\documentclass[tikz, border=5mm]{standalone}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd} u_i
\arrow["?"', loop, distance=2em, in=125, out=55]
\arrow[rr, "{(g^{-1}u_i,g^{-1})}"{anchor=south},% <-- add anchor
bend left] & &
g^{-1}u_ig
\arrow[ll, "{(u_i g,g)}"{anchor=north},% <-- add anchor
bend left]
\arrow["{(u,v)}"', loop, distance=2em, in=125, out=55]
\end{tikzcd}
\end{document}