# Diagrams in category theory

Can someone help me please? I'm wondering how to draw this diagram with LaTeX. Thanks.

• Welcome to TeX.SE! Such things can be drawn very conveniently with tikz-cd. – user121799 Jan 6 '19 at 22:53
• Try \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} A \arrow[r,"b"] \arrow[d,"g"] & C \arrow[r,"\alpha"] \arrow[d,"\beta"]& D \arrow[d,"\gamma"]\\ B \arrow[rru,"h"] & B' \arrow[r,"\omega"] & D' \end{tikzcd} \end{document} – user121799 Jan 6 '19 at 22:59
• @marmot You're flash. I lost many times with Captcha. :-( – Sebastiano Jan 6 '19 at 23:08
• @Sebastiano Slow marmots get caught by the eagles. – user121799 Jan 6 '19 at 23:09

You can easily draw your diagrams with the free online tool tikzcd-editor.

Screenshot:

Generated Code by clicking the {} button (not an MWE):

\begin{tikzcd}
A \arrow[d, "g"] \arrow[r, "f"] & B \arrow[r, "\alpha"] \arrow[d, "\gamma"] & D \arrow[d, "\beta"] \\
C \arrow[rru, "h"] & B' \arrow[r, "\lambda"] & D'
\end{tikzcd}


• Certainly a very nice tool, where can you find the instructions for use? – AndréC Jan 7 '19 at 16:50
• Is it possible to remove the grid in the editor you linked above to take a screenshot? – Zhiltsoff Igor Oct 13 at 8:16
• @ZhiltsoffIgor Yes, remove or comment out the line containing border: 2px dashed #ccc; in the .grid-cell class in master.css. – Henri Menke Oct 13 at 8:45

Here is a proposal.

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A \arrow[r,"b"] \arrow[d,"g"] & C \arrow[r,"\alpha"] \arrow[d,"\gamma",pos=0.4,swap]& D \arrow[d,"\beta"]\\
B \arrow[rru,"h",pos=0.7,swap] & B' \arrow[r,"\omega"] & D'
\end{tikzcd}
\end{document}


I added the proposal to prove that users are willing to help. However, the purpose of this site is not to get screen shots converted to LaTeX code. Rather, the idea is that you try something, and if you get stuck, you have a code that you can show and others will help you solve that problem.

My code is only "basic".

\documentclass{standalone}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A \arrow[r, "f"] \arrow[d, "g"'] & B \arrow[r, "\alpha"] \arrow[d, "h"'] & D \arrow[d, "\beta"] \\
C \arrow[rru, "\gamma"'] & B' \arrow[r, "\lambda"'] & D'
\end{tikzcd}
\end{document}


Another possibility is with pstricks– more precisely the psmatrix environment:

\documentclass[border=8pt]{standalone}

\usepackage{pst-node, auto-pst-pdf}

\begin{document}

$\begin{psmatrix}[colsep =1.2cm, rowsep=1.2cm, nodesepA=2pt, nodesepB=1pt, shortput=nab, labelsep=1pt, arrows=->, arrowinset=0.12, linewidth=0.6pt] A & B & D \\ C & B' & D' %% horizontal maps \ncline{1,1}{1,2}^{b} \ncline{1,2}{1,3}^{\alpha} \ncline{2,2}{2,3}_{\lambda} %% oblique map \ncline{2,1}{1,3}\naput[npos=0.7]{h} %% vertical maps \ncline{1,1}{2,1}<{g} \ncline[border=1pt]{1,2}{2,2}\nbput[npos=0.35]{\gamma} \ncline{1,3}{2,3} >{\beta} \end{psmatrix}$

\end{document}