我有以下图表,其中使用了以下代码
\begin{tikzcd}
\phi\times\psi\times\theta \arrow[r,"_{X_{p}}{\circ}_{Y_q}\times \Id"]
\arrow[d,"\cong"]
&
(\phi _{X_p}\circ _{Y_q}\psi)\times \theta\arrow[d]
\\
\phi\times \theta \times \psi \arrow[d,"_{X_r}\circ_{Z_t}\times \Id"']
&
\arrow[d,phantom]
\\
(\phi _{X_r}\circ_{Z_t})\times \psi\arrow[r,"(\phi_{X_r}\circ_{Z_t}\theta)_{X_p}\circ_{Y_q}\psi"]
&
(\phi_{X_p}\circ_{Y_q}\psi)_{X_r}\circ_{Z_t}\theta
\end{tikzcd}
在此图中,您可以看到其中一个箭头没有一直延伸到右下角(这正是我想要它到达的地方)。您还可以看到图表底部的标签离箭头太近了。我想将它向下移动一点。
看来我必须在 (2,2) 节点处添加一些东西,否则 Latex 甚至不会编译该图。因此我放了虚线箭头。下面是我的交换图的图片。
答案1
已应用column sep = 80
和row sep = 30
未应用\hspace
:
\documentclass[]{standalone}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd} [column sep = 80, row sep = 30]
\phi\times\psi\times\theta \arrow[d,"\cong"] \arrow[r,"{X_p}{\circ}_{Y_q}\times Id"] &
(\phi _{X_p}\circ _{Y_q}\psi)\times \theta\arrow[dd] \\
\phi\times\psi\times\psi \arrow[d,"X_r{\circ}_{Z_t}\times Id"'] & \\
(\phi _{X_r}\circ_{Z_t})\times \psi \ar[r,"(\phi_{X_r}\circ_{Z_t}\theta)_{X_p}\circ_{Y_q}\psi"]
& (\phi_{X_p}\circ_{Y_q}\psi)_{X_r}\circ_{Z_t}\theta
\end{tikzcd}
\end{document}
答案2
只需使用\arrow[dd]
(无需\arrow[d,phantom]
)。
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator\Id{Id}
\usepackage{tikz}
\usetikzlibrary{cd}
\begin{document}
\begin{tikzcd}
\phi\times\psi\times\theta \arrow[r,"_{X_{p}}{\circ}_{Y_q}\times \Id"] \arrow[d,"\cong"] & (\phi _{X_p}\circ _{Y_q}\psi)\times \theta\arrow[dd] \\
\phi\times \theta \times \psi \arrow[d,"_{X_r}\circ_{Z_t}\times \Id"'] & \\
(\phi _{X_r}\circ_{Z_t})\times \psi\arrow[r,"(\phi_{X_r}\circ_{Z_t}\theta)_{X_p}\circ_{Y_q}\psi"] & (\phi_{X_p}\circ_{Y_q}\psi)_{X_r}\circ_{Z_t}\theta \\
\end{tikzcd}
\end{document}
答案3
\arrow[dd]
命令取自 Henri Menke 的回答,我用它shorten
来改变箭头的长度并\hspace*{}
改变文本的水平位置,以使外观更好。
\documentclass[a4paper,10pt]{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
\phi\times\psi\times\theta \arrow[d,"\cong"] \arrow[r,"{X_p}{\circ}_{Y_q}\times Id"] & (\phi _{X_p}\circ _{Y_q}\psi)\times \theta\arrow[dd] \\
\phi\times\psi\times\psi \arrow[d,"X_r{\circ}_{Z_t}\times Id"'] & \\
(\phi _{X_r}\circ_{Z_t})\times \psi \ar[r,shorten >=- 1.7cm,"\hspace*{1.4cm}(\phi_{X_r}\circ_{Z_t}\theta)_{X_p}\circ_{Y_q}\psi"]
& \hspace*{1.7cm}(\phi_{X_p}\circ_{Y_q}\psi)_{X_r}\circ_{Z_t}\theta
\end{tikzcd}
\end{document}