我想绘制一个如下所示的多重“交换”图:
我的工作试验如下:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes, row sep=3em,
column sep=3em]{
& MC_1 & & TM_1\\
MC_2 & & TM_2 & \\
& BM_1 & & TM_2 \\
BM_2 & & FM_2 & \\};
\path[-stealth]
(m-1-2) edge (m-1-4) edge (m-2-1) edge (m-3-2)
(m-1-4) edge (m-3-4) edge (m-2-3)
(m-2-1) edge [-,line width=6pt,draw=white] (m-2-3)
edge (m-2-3) edge (m-4-1)
(m-3-2) edge (m-3-4)
edge (m-4-1)
(m-4-1) edge (m-4-3)
(m-3-4) edge (m-4-3)
(m-2-3) edge [-,line width=6pt,draw=white] (m-4-3)
edge (m-4-3);
\end{tikzpicture}
\end{document}
产生:
我需要箭头为蓝色,线条为黑色。如何实现?请帮忙。
答案1
这是tikz-cd
:
\documentclass{article}
\usepackage{amsmath,tikz-cd}
\begin{document}
\[
\begin{tikzcd}[row sep=6ex,column sep=2em]
&&& \mathrm{MC}_1 \arrow[rr,blue] \arrow[d,blue] \arrow[ddl,dash] &&
\mathrm{TM}_1 \arrow[ddl,dash] \\
&&& \mathrm{BM}_1 \arrow[rr,blue] \arrow[ddl,dash] &&
\mathrm{FM}_1 \arrow[u,blue] \arrow[ddl,dash]
\\[-4ex]
&& \mathrm{MC}_2 \arrow[rr,blue] \arrow[d,blue] \arrow[ddl,dash] &&
\mathrm{TM}_2 \arrow[ddl,dash] \\
&& \mathrm{BM}_2 \arrow[rr,blue] \arrow[ddl,dash] &&
\mathrm{FM}_2 \arrow[u,blue] \arrow[ddl,dash]
\\[-4ex]
& \mathrm{MC}_3 \arrow[rr,blue] \arrow[d,blue] \arrow[ddl,dash] &&
\mathrm{TM}_3 \arrow[ddl,dash] \\
& \mathrm{BM}_3 \arrow[rr,blue] \arrow[ddl,dash] &&
\mathrm{FM}_3 \arrow[u,blue] \arrow[ddl,dash]
\\[-4ex]
\mathrm{MC}_4 \arrow[rr,blue] \arrow[d,blue] &&
\mathrm{TM}_4 \\
\mathrm{BM}_4 \arrow[rr,blue] &&
\mathrm{FM}_4 \arrow[u,blue]
\end{tikzcd}
\]
\end{document}