以下是具有相交箭头的交换图的代码
\documentclass[12pt]{article}
\usepackage[pdftex,pagebackref,letterpaper=true,colorlinks=true,pdfpagemode=none,urlcolor=blue,linkcolor=blue,citecolor=blue,pdfstartview=FitH]{hyperref}
\usepackage{amsmath,amsfonts}
\usepackage{graphicx}
\usepackage{color}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[row sep=huge, column sep=huge]
(X, \mathcal{T})
\arrow{r}{\text{Id}_X}
\arrow{d}{q'}
\arrow[swap]{dr}{f_3 \circ q'}
& (X, \mathcal{T})
\arrow{dr}{f_1 \circ q'}
\arrow{r}{\text{Id}_X}
\arrow{d}{q'}
\arrow{r}{\text{Id}_X}
& (X, \mathcal{T})
\arrow{d}{q}
\arrow{dl}{f_2 \circ q} \\
(Y, \mathcal{T})
\arrow{r}{f_3}
& (Y, \mathcal{T})
\arrow{r}{f_1}
\arrow[r,<-,shift right,swap, "f_2"]{f_2}
& (Y, \mathcal{Q})
\end{tikzcd}
\]
\end{document}
生成以下内容。我的问题是如何让右侧方块上的文本看起来更好?
答案1
为了明确关联关系,你可以在斜坡上贴上标签。
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\DeclareMathOperator\Id{Id}
\begin{document}
\[
\begin{tikzcd}[row sep=huge, column sep=huge]
(X, \mathcal{T})
\arrow{r}{\Id_X}
\arrow{d}{q'}
\arrow[swap]{dr}{f_3 \circ q'}
& (X, \mathcal{T})
\arrow[sloped,pos=.1]{dr}{f_1 \circ q'}
\arrow{r}{\Id_X}
\arrow{d}{q'}
\arrow{r}{\Id_X}
& (X, \mathcal{T})
\arrow{d}{q}
\arrow[sloped,pos=.3]{dl}{f_2 \circ q} \\
(Y, \mathcal{T})
\arrow{r}{f_3}
& (Y, \mathcal{T})
\arrow{r}{f_1}
\arrow[r,<-,shift right,swap, "f_2"]{f_2}
& (Y, \mathcal{Q})
\end{tikzcd}
\]
\end{document}