我用这段代码画了一个交换图
\documentclass{article}
\usepackage{tikz-cd}
\usepackage{etoolbox}
\begin{document}
\begin{equation}
\begin{tikzcd}[arrows]
\node(P0) at (90:2.6cm){V};
\node(P1) at (90+72:2.5cm){X} ;
\node(P2) at (90+2*72:4cm){Y};
\node(P3) at (90+3*72:4cm){W};
\node(P4) at (90+4*72:2.5cm){U};
\node(P5) at (270+5*72:4.6cm){Z};
\arrow[from=P1,to=P0,"f_{1}"']
\arrow[from=P0,to=P4,"f_{2}"']
\arrow[from=P1,to=P4,"f_{3}"']
\arrow[from=P1,to=P3,"f_{4}"]
\arrow[from=P1,to=P2,"f_{6}"]
\arrow[from=P4,to=P3,"f_{5}"]
\arrow[from=P2,to=P5,"f_{7}"]
\arrow[from=P5,to=P3,"f_{8}"]
\end{tikzcd}
\end{equation}
\end{document}
答案1
诀窍是在第 2 行和第 3 行之间添加一些垂直空间。几乎不需要明确的长度。
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}
& V \arrow[dr,"f_2"] \\
X \arrow[ur,"f_1"] \arrow[rr,"f_3"] \arrow[drr,"f_4"] \arrow[d,"f_6"']
&& U \arrow[d,"f_5"] \\[2em]
Y \arrow[dr,"f_7"'] && W \\
& Z \arrow[ur,"f_8"']
\end{tikzcd}
\]
\end{document}
我改变了一些标签的位置,请根据你的喜好进行调整。尝试一下,2em
并稍微缩短一点,以获得更“六边形”的形状。
答案2
我非常喜欢...如何替代经典tikz-cd
包xy
。我添加了我的 MWE 和行距。Peraphs 可能类似于六边形 :-) 就像代码:-);您可以通过更改点的参数来调整行和列的@R
六边形2.5pc
@egreg
\xymatrix@R=...pc@C=....pc.
\documentclass[a4paper,12pt]{article}
\usepackage[all,cmtip]{xy}
\begin{document}
\xymatrix@R=2.5pc{
& V \ar[dr]^{f_2}& \\
X \ar[rr]^{f_3} \ar[ur]^{f_1} \ar[d]_{f_6} \ar[drr]^{f_4} & & U\ar[d]^{f_5} \\
Y \ar[dr]_{f_7}& & W\\
& Z \ar[ur]_{f_8}&
}
\end{document}
PS:您放大了直线......这是输出的光学效果。