在交换图中移动标签

在交换图中移动标签

我制作了以下交换图:

在此处输入图片描述

这是我的代码:

 \[\begin{tikzcd} 
&&&\ar[dl,"\pi_1",swap](A\times B)\times C\ar[dr,"f_1",dotted,swap]\ar[drr,"\pi_2"]\ar[dd,bend right, dotted,"s",]&& \\
&A &\ar[l,"\pi_5",swap] A\times B \ar[r,"\pi_6"]& B &\ar[l,"\pi_7",swap] B\times C\ar[r,"\pi_8",swap] & C \\
&&&A\times (B\times C)\ar[ull,"\pi_3"]\ar[ul,dotted,"f_2",swap]\ar[ur,"\pi_4"]\ar[uu,bend right, dotted,"r",]&&
\end{tikzcd}\]

我的问题是标签 $r$ 和 $s$ 不可读。我该如何移动它们来解决这个问题?

答案1

您可以添加near endnear start

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\[
\begin{tikzcd} 
&&& (A\times B)\times C
    \ar[dl,"\pi_1",swap]
    \ar[dr,"f_1",dotted,swap]
    \ar[drr,"\pi_2"]\ar[dd,bend right, dotted,near start,"s",]
\\
& A
& A\times B
  \ar[l,"\pi_5",swap] 
  \ar[r,"\pi_6"]
& B
& B\times C
  \ar[l,"\pi_7",swap]
  \ar[r,"\pi_8",swap]
& C
\\
&&& A\times (B\times C)
    \ar[ull,"\pi_3"]
    \ar[ul,dotted,"f_2",swap]
    \ar[ur,"\pi_4"]\ar[uu,bend right, dotted,near end,"r",]
\end{tikzcd}
\]

\end{document}

在此处输入图片描述

可能添加swap就更好了:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\[
\begin{tikzcd} 
&&& (A\times B)\times C
    \ar[dl,"\pi_1",swap]
    \ar[dr,"f_1",dotted,swap]
    \ar[drr,"\pi_2"]\ar[dd,bend right, dotted,near end,swap,"s",]
\\
& A
& A\times B
  \ar[l,"\pi_5",swap] 
  \ar[r,"\pi_6"]
& B
& B\times C
  \ar[l,"\pi_7",swap]
  \ar[r,"\pi_8",swap]
& C
\\
&&& A\times (B\times C)
    \ar[ull,"\pi_3"]
    \ar[ul,dotted,"f_2",swap]
    \ar[ur,"\pi_4"]\ar[uu,bend right, dotted,near end,swap,"r",]
\end{tikzcd}
\]

\end{document}

在此处输入图片描述

相关内容