使用 tikz-cd 在两点之间画一个箭头

使用 tikz-cd 在两点之间画一个箭头

我画了下图,我想在中间(K 和 P 之间)写上“j”作为描述,但是它没有出现。我的代码是:

\documentclass{article}
\usepackage{amsmath,tikz-cd}
\begin{document}
\begin{equation*}
\begin{tikzcd}[row sep=huge,column sep=huge]
0 \arrow{r} & P \arrow{r}{\begin{bmatrix}
    p_{2} \\ p_{1}
    \end{bmatrix}
} 
& B \bigoplus A \arrow{r}{\begin{bmatrix}
    \alpha_{2} ~~ -\alpha_{1}
    \end{bmatrix}
} & C \\
& P^{\prime} \arrow[ur,"{\begin{bmatrix}
    {p^{\prime}}_{2} \\ {p^{\prime}}_{1}
\end{bmatrix}}" description] \arrow[r,dotted,"\exists!~u"'] & K 
\arrow[u,tail,"i ~ = ~ \begin{bmatrix}
    i_{B} \\ i_{A}
    \end{bmatrix}"'] 
\arrow[ul,"j" description, to path={-- 
([yshift=-2ex,xshift=-3ex]\tikztostart.south) -| 
([yshift=-2ex,xshift=-3ex]\tikztotarget.south) -- (\tikztotarget)}]
\end{tikzcd}
\end{equation*}
\end{document}

在此处输入图片描述

答案1

像这样?

在此处输入图片描述

路径标签被添加为路径上的节点:

\documentclass{article}
\usepackage{amsmath,tikz-cd}
\begin{document}
\[
\begin{tikzcd}[row sep=huge,column sep=huge]
0 \arrow{r} & P \arrow{r}{\begin{bmatrix}
    p_{2} \\ p_{1}
    \end{bmatrix}
}
& B \bigoplus A \arrow{r}{\begin{bmatrix}
    \alpha_{2} ~~ -\alpha_{1}
    \end{bmatrix}
} & C \\
& P^{\prime} \arrow[ur,"{\begin{bmatrix}
    {p^{\prime}}_{2} \\ {p^{\prime}}_{1}
\end{bmatrix}}" description] \arrow[r,dotted,"\exists!~u"'] & K
\arrow[u,tail,"i = \begin{bmatrix}
    i_{B} \\ i_{A}
    \end{bmatrix}"']
\arrow[to path={-- ([shift={(-2ex,-3ex)}]\tikztostart.south)
                -| ([shift={(-2ex,-3ex)}]\tikztotarget.south) node[pos=0.25,below,font=\footnotesize] {$j$} % <---
                -- (\tikztotarget)},
                ul]
\end{tikzcd}
\]
\end{document}

编辑: 从您的评论中我们可以猜测您正在寻找以下解决方案:

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath,tikz-cd}
\begin{document}
\[
\begin{tikzcd}[row sep=22mm,column sep=huge]
0 \arrow{r} & P \arrow{r}{\begin{bmatrix}
    p_{2} \\ p_{1}
    \end{bmatrix}
}
& B \bigoplus A \arrow{r}{\begin{bmatrix}
    \alpha_{2} ~~ -\alpha_{1}
    \end{bmatrix}
} & C \\
& P' \arrow[ur,"{\begin{bmatrix}
    {p'}_{2} \\ {p'}_{1}
\end{bmatrix}}"  description, pos=0.25] \ar[r,dotted,"\exists!~u"'] & K
\arrow[u,tail,"i = \begin{bmatrix}
    i_{B} \\ i_{A}
    \end{bmatrix}"']
\arrow[ul,"j" description, pos=0.25]
\end{tikzcd}
\]
\end{document}

相关内容