在下圖中,我想讓G^F
虛線箭頭上的標籤居中:
然而,修改pos
似乎不起作用,因為pos=0.41
和之間似乎存在“跳躍” pos=0.42
。
有什麼方法可以讓標籤居中嗎? (實際上,我很好奇為什麼它不默認居中或不居中pos=0.5
)
下面是 MWE。
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
& A \\
C & \widehat{C}
\arrow["{F}", from=2-1, to=1-2]
\arrow["{Y}"', from=2-1, to=2-2]
\arrow["{N^F}"', "{\vdash}"{inner sep=.3ex}, from=1-2, to=2-2]
\arrow["{G^F}"'{pos=.41}, dashed, bend right, from=2-2, to=1-2]
\end{tikzcd}
\end{document}
答案1
當彎曲箭頭非常短時,這是一個問題。兩個建議:
- 增加
sep
以使節點相距更遠。 - 減小
bend
角度。我bend right=15
在圖中使用了。 (那麼您可能也想shift
向右箭頭。)
這是代碼:
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[sep=large]
& A \\
C & \widehat{C}
\arrow["F", from=2-1, to=1-2]
\arrow["Y"', from=2-1, to=2-2]
\arrow["N^F"', "{\vdash}"{inner sep=.3ex}, from=1-2, to=2-2]
\arrow["G^F"', dashed, bend right=15, shift right=1.5, from=2-2, to=1-2]
\end{tikzcd}
\end{document}