TransWikia.com

How to draw multiple commutative diagram like this one?

TeX - LaTeX Asked on December 31, 2021

I want to draw a multiple ‘commutative’ diagram that looks as follows:

enter image description here

My working trial is as follows:

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}

that produces:

enter image description here

I need the arrow to be in blue color and the line in black. How to achieve this? Please help.

One Answer

This is with 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}

enter image description here

Answered by egreg on December 31, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP