我正在尝试绘制类似于以下的交换图:
...除了我希望两个箭头$1 \times \tilde{I}$
和$\tilde{m}$
在同一条线上,并且节点$\tilde{G} \times \tilde{G}$
位于中间位置。这是我的代码(虽然它可能没有帮助):
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
& & & \tilde{G} \arrow{dd}{p}\\
& & \tilde{G} \times \tilde{G} \arrow{ru}{\tilde{m}} & \\
\tilde{G} \arrow{rru}{1 \times \tilde{I}} \arrow[swap]{r}{p} & G
\arrow[swap]{r}{1_{G}\times I} & G \times G \arrow[swap]{r}{m} & G
\end{tikzcd}
\end{document}
有什么建议吗?谢谢!
答案1
与 Zarko 的解决方案类似,但方法不同;主要技巧还是使用虚拟行。指定between origins
可确保网格状布置。
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep={6em,between origins},row sep={2.5em,between origins}]
& & & \tilde{G} \arrow[ddd,"p"] \\
& & \tilde{G} \times \tilde{G} \arrow[ru,"\tilde{m}"] & \\
\\
\tilde{G} \arrow[rruu,"1\times\tilde{I}"] \arrow[r,swap,"p"] & G
\arrow[r,swap,"1_{G}\times I"] & G \times G \arrow[r,swap,"m"] & G
\end{tikzcd}
\end{document}
另一个版本,入口位于中间的对角箭头之间。这里的技巧是多使用一列,但在其两侧向后退一半的列宽。
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep={6em,between origins},row sep={2.5em,between origins},nodes in empty cells]
& &[-3em] &[-3em] & \tilde{G} \arrow[dd,"p"] \\
& & \tilde{G} \times \tilde{G} \arrow[rru,"\tilde{m}"] \\
\tilde{G} \arrow[rru,"1\times\tilde{I}"] \arrow[r,swap,"p"] &
G \arrow[rr,swap,"1_{G}\times I"] & & G \times G \arrow[r,swap,"m"] & G
\end{tikzcd}
\end{document}
答案2
尝试:
\documentclass[12pt]{standalone}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[nodes in empty cells,
cells={nodes={minimum height=1.5em}}]
& & & \tilde{G} \arrow{ddd}{p}\\
& & \tilde{G} \times \tilde{G} \arrow{ru}{\tilde{m}} & \\%[5ex]
& & & \\
\tilde{G} \arrow{rruu}{1 \times \tilde{I}} \arrow[swap]{r}{p} & G
\arrow[swap]{r}{1_{G}\times I} & G \times G \arrow[swap]{r}{m} & G
\end{tikzcd}
\end{document}
附录:通过减小节点的row sep
和 可以获得不太陡的斜率:inner sep
\documentclass[12pt]{standalone}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[nodes in empty cells,
row sep=-1ex,
cells={nodes={minimum height=1.5em, inner sep=2pt}}]
& & & \tilde{G} \arrow{ddd}{p}\\
& & \tilde{G} \times \tilde{G} \arrow{ru}{\tilde{m}} & \\%[5ex]
& & & \\
\tilde{G} \arrow{rruu}{1 \times \tilde{I}} \arrow[swap]{r}{p} & G
\arrow[swap]{r}{1_{G}\times I} & G \times G \arrow[swap]{r}{m} & G
\end{tikzcd}
\end{document}