I would like to learn to make commutative rectangles using Tikz. How can I do that? I have tried
\[\begin{tikzcd}
A \arrow{r}{\varphi} \arrow[swap]{dd}{g\circ f} & B \arrow{d}{g} \\
& C
\end{tikzcd}
\]
but it draws only a triangle.
diagramstikz-cd
I would like to learn to make commutative rectangles using Tikz. How can I do that? I have tried
\[\begin{tikzcd}
A \arrow{r}{\varphi} \arrow[swap]{dd}{g\circ f} & B \arrow{d}{g} \\
& C
\end{tikzcd}
\]
but it draws only a triangle.
Best Answer
I don't know what you exactly wanted to draw, so I reproduce one of the diagrams from your link, showing how to do it with
pst-node
and withtikz-cd
. One of the main differences is that inpstricks
you first describe the nodes, then the arrows, while withtikz-cd
, nodes and arrows are described simultaneously.I load
auto-pst-pdf
, as pdflatex doesn't support postscript instructions. You have to set the--enable-write18
compiler switch (MiKTeX) or-shell-escape
(TeX Live, MacTeX). Alternatively, you can compile withxelatex
.