tikz-cd: 曲がった矢印のラベルの位置

tikz-cd: 曲がった矢印のラベルの位置

G^F次の図では、破線矢印のラベルを中央に配置したいと思います。

ここに画像の説明を入力してください

ただし、とposの間に「ジャンプ」があるように見えるため、変更は機能しないようです。pos=0.41pos=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

これは、曲がった矢印が非常に短い場合に発生します。 2 つの提案:

  1. sepノード間の距離が広がるように増やします。
  2. 角度を小さくします。図でbend使用しました。(その後、矢印も右にする必要があります。)bend right=15shift

ここに画像の説明を入力してください

コードは次のとおりです:

\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}

ここに画像の説明を入力してください

関連情報