[Tex/LaTex] Commutative diagrams package

diagrams

I want to put one of those great category theoretic diagrams into one of my papers. What sort of packages can I use without breaking my TeX work so far.

Best Answer

I recommend tikz-cd. Let's see some examples (the last one is from page 3 of these notes

\documentclass{amsart}
\usepackage{tikz-cd}

\DeclareMathOperator{\Hom}{Hom}

\begin{document}
\section{Commutative $k$-algebra}
\[
\begin{tikzcd}
A\otimes A \arrow[rr,"\iota"] \arrow[dr,swap,"\mu"] && A\otimes A \arrow[dl,"\mu"] \\
& A
\end{tikzcd}
\]

\section{Cocommutative $k$-coalgebra}
\[
\begin{tikzcd}
& C \arrow[dl,swap,"\Delta"] \arrow[dr,"\Delta"] \\
C\otimes C \arrow[rr,"\iota"] && C\otimes C
\end{tikzcd}
\]

\section{Associative $k$-algebra}
\[
\begin{tikzcd}
A\otimes A\otimes A \arrow[r,"\mu\otimes 1"] \arrow[d,swap,"1\otimes\mu"] &
  A \otimes A \arrow[d,"\mu"] \\
A \otimes A \arrow[r,"\mu"] & A
\end{tikzcd}
\]
\section{Coassociative $k$-coalgebra}
\[
\begin{tikzcd}
C \arrow[r,"\Delta"] \arrow[d,swap,"\Delta"] &
  C \otimes C \arrow[d,"1\otimes\Delta"] \\
C\otimes C \arrow[r,"\Delta\otimes 1"] & C\otimes C\otimes C
\end{tikzcd}
\]

\section{Hochschild cohomology complex}
\[
\begin{tikzcd}
0 \arrow[r] & M \arrow[r,"\partial_0-\partial_1"] &
  \Hom_k(R,M) \arrow[r,"d"] & \Hom_k(R\otimes R,M) \arrow[r,"d"] & \dotsb
\end{tikzcd}
\]
\end{document}

Note that triangular diagrams are realized by adding an intermediate column.

enter image description here