我想画一个交换图,我画了,但它太大了,一页都放不下,我想缩短箭头的长度。我更改了列分隔值,但没有成功。有什么想法吗?
\begin{tikzcd}[row sep=1.5em, column sep = .000001em]
&&
Hom_H(P_n,A) \arrow[rr,"\alpha"] \arrow[dr,dashed, swap,"d_n"] \arrow[dd,swap] &&
Hom_H(P_n,B)\arrow[dd] \arrow[dr,dashed,swap,"d_n"] \arrow[rr,"\beta"]&&
Hom_H(P_n,C) \arrow[rr]\arrow[dr,dashed ,swap,"d_n "]\arrow[dd] &&0\\
&0\arrow[rr] && Hom_H(P_{n+1},A) \arrow[rr,"\alpha",near start] \arrow[dd]&&
Hom_H(P_{n+1},B) \arrow[dd]\arrow[rr,"\beta",near start]&&
Hom_H(P_{n+1},C) \arrow[dd]\\
&&
Hom_G(P_n,A') \arrow[rr,"\alpha'",near start] \arrow[dr,dashed,swap,"d_n "] && Hom_G(P_n,B') \arrow[dr,dashed,swap,"d_n "]\arrow[rr,"\beta'",very near start]&& Hom_G(P_n,C')\arrow[dr,dashed,swap,"d_n "]\arrow[rr]&&0 \\
&0\arrow[rr]&& Hom_G(P_{n+1},A') \arrow[rr,"\alpha'"]&& Hom_G(P_{n+1},B')\arrow[rr,"\beta'"]&& Hom_G(P_{n+1},C')
\end{tikzcd}```
答案1
您可以使用消极的列分隔。对于只有零的窄列,您可以通过执行 来显式添加间距来修复它&[1em]
。
我建议不要对对角箭头这样做swap
,并且使用crossing over
(这需要推迟一些箭头的绘制)。
\documentclass{article}
\usepackage{amsmath,tikz-cd}
\DeclareMathOperator{\Hom}{Hom}
\begin{document}
\[
\begin{tikzcd}[row sep=1.5em, column sep = -2em]
&&[1em]
\Hom_H(P_n,A) \arrow[rr,"\alpha"] \arrow[dr,dashed, "d_n"] \arrow[dd,swap] &&
\Hom_H(P_n,B) \arrow[dd] \arrow[dr,dashed,"d_n"] \arrow[rr,"\beta"]&&
\Hom_H(P_n,C) \arrow[rr]\arrow[dr,dashed ,"d_n "] \arrow[dd] &&[1em]
0
\\
&
0\arrow[rr,crossing over] &&
\Hom_H(P_{n+1},A) \arrow[rr,"\alpha",near start,crossing over] &&
\Hom_H(P_{n+1},B) \arrow[rr,"\beta",near start,crossing over] &&
\Hom_H(P_{n+1},C)
\\
&&
\Hom_G(P_n,A') \arrow[rr,"\alpha'",near start] \arrow[dr,dashed,"d_n "] &&
\Hom_G(P_n,B') \arrow[dr,dashed,"d_n "] \arrow[rr,"\beta'",very near start] &&
\Hom_G(P_n,C') \arrow[dr,dashed,"d_n "] \arrow[rr] &&
0
\\
&
0\arrow[rr] &&
\Hom_G(P_{n+1},A') \arrow[rr,"\alpha'"] \arrow[from=uu,crossing over] &&
\Hom_G(P_{n+1},B') \arrow[rr,"\beta'"] \arrow[from=uu,crossing over] &&
\Hom_G(P_{n+1},C') \arrow[from=uu,crossing over]
\end{tikzcd}
\]
\end{document}
这使得标准文本宽度的框溢出约 7pt article
。我可以稍微更改列分隔以使其适合,但这需要知道您使用的文本宽度。
注意“Hom”要如图所示直立。
答案2
为了好玩,用以下方法制作了相同的图表pstricks
:
\documentclass[border=10pt]{standalone}
\usepackage{amsmath}
\DeclareMathOperator{\Hom}{Hom}
\usepackage{pst-node}
\begin{document}
$ \begin{psmatrix}[colsep=0.4cm, rowsep=0.8cm]
& \Hom_H(P_n,A) & & \Hom_H(P_n,B) & & \Hom_H(P_n,C) & & 0\\
0 & & \Hom_H(P_{n+1},A) & & \Hom_H(P_{n+1},B) & & \Hom_H(P_{n+1},C) \\
& \Hom_G(P_n,A) & & \Hom_G(P_n,B) & & \Hom_G(P_n,C) & & 0\\
0 & & \Hom_G(P_{n+1},A) & & \Hom_G(P_{n+1},B) & & \Hom_G(P_{n+1},C)
%% arrows
\psset{linewidth=0.5pt, arrowsize=4pt, arrows=->, linejoin=1, nodesep=4pt, labelsep=2pt}
%% vertical arrows
\foreach \i in{2,4,6}{\ncline{1,\i}{3,\i}}
%% horizontal arrows
\foreach \i/\j/\k/\label in {1/2/4/\alpha, 1/4/6/\beta, 2/3/5/\alpha, 2/5/7/\beta}
{\ncline[border=3pt]{\i,\j}{\i,\k}\naput[npos=0.43]{\label}}
\foreach \i/\j/\k/\label in {3/2/4/\alpha', 3/4/6/\beta', 4/3/5/\alpha', 4/5/7/\beta'} {\ncline{\i,\j}{\i,\k}\naput[npos=0.43]{\label}}
\ncline[border=3pt]{2,1}{2,3}\ncline[border=3pt]{4,1}{4,3}
\ncline{1,6}{1,8}\ncline[border=3pt]{3,6}{3,8}
%% foreground vertical arrows
\foreach \i in{3,5,7}{\ncline[border=3pt]{2,\i}{4,\i}}
%% \dashed arrows
\foreach \i/\j in {2/3,4/5,6/7}{\psset{npos=0.3, linestyle=dashed, dash=3pt 2pt, labelsep=1pt}%
\ncline{1,\i}{2,\j}\nbput{d_n}\ncline{3,\i}{4,\j}\nbput{d_n}}
\end{psmatrix} $
\end{document}