Can someone help me please? I'm wondering how to draw this diagram with LaTeX. Thanks.
4 Answers
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}
-
4Certainly a very nice tool, where can you find the instructions for use?– AndréCJan 7, 2019 at 16:50
-
Is it possible to remove the grid in the editor you linked above to take a screenshot? Oct 13, 2020 at 8:16
-
1@ZhiltsoffIgor Yes, remove or comment out the line containing
border: 2px dashed #ccc;
in the.grid-cell
class inmaster.css
. Oct 13, 2020 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}
-
! Package auto-pst-pdf Error: "shell escape" (or "write18") is not enabled: auto-pst-pdf will not work!, use -shell-escape to resove– sunxdAug 29 at 13:48
tikz-cd
.\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}