tikz-cd:彎曲箭頭上的標籤定位

tikz-cd:彎曲箭頭上的標籤定位

在下圖中,我想讓G^F虛線箭頭上的標籤居中:

在此輸入影像描述

然而,修改pos似乎不起作用,因為pos=0.41和之間似乎存在“跳躍” pos=0.42

在此輸入影像描述( 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

當彎曲箭頭非常短時,這是一個問題。兩個建議:

  1. 增加sep以使節點相距更遠。
  2. 減小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}

答案2

僅用於與xy包裝進行比較:

\documentclass[a4paper,12pt]{article}
\usepackage[cmtip,all]{xy}
\begin{document}
\xymatrix@R=2pc@C=3pc{ & A \ar[d]^{\vdash}\\
C \ar[ur]^F_(.70){N^F} \ar[r]_Y & \widehat{C} \ar@/_1.2pc/@{-->}[u]_{G^F}
}
\end{document}

在此輸入影像描述

相關內容