I am using the tikz-cd
package. How can I draw the above diagram in LaTeX?
2 Answers
Just because I wanted to see exactly how fast one could do this with the package manual in hand, here is the diagram in tikz-cd:
\documentclass[a4paper]{article}
\usepackage{tikz-cd}
\usetikzlibrary{babel} % incase you're using babel
\begin{document}
\[
\begin{tikzcd}
{}
&
{}
&
A
\ar[ld,hook']
\ar[rd,"f"',"\cong"]
&
{}
\\
B'
\ar[r,hook]
&
B
\ar[rd,"s"',"\cong"]
\ar[rdd,bend right,"j"']
&
{}
&
C
\ar[ld,hook',"h"]
\ar[ldd,bend left,"k"]
\\
{} & {} & D & {}
\\
{} & {} & E & {}
\\
\end{tikzcd}
\]
\end{document}
- Bendy arrows, manual page 3
- Hook arrow, manual page 4 note the syntax for hook up/down
- The syntax for the labels including the
"..."'
syntax is covered on page 2 in the manual
See also egregs answer for tips on how to further adjust the look
-
1It's nice when all relevant information is in the first four pages of a manual
:-D
– campaFeb 10, 2020 at 13:50
Just a few adjustments to make the square a square and the bottom vertical row a bit longer.
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
\begin{equation*}
\begin{tikzcd}[row sep=2.5em]
&& A \arrow[ld,hook'] \arrow[rd,"f","\cong"']
\\
B' \arrow[r,hook] &
B \arrow[rd,"\cong","g"'] \arrow[rdd,bend right,"j"'] &&
C \arrow[ld,hook',"h"] \arrow[ldd,bend left,"k"]
\\
&& D \arrow[d]
\\[0.5em]
&& E
\end{tikzcd}
\end{equation*}
\end{document}
With "<symbol>"'
(note the quote) we say to typeset the symbol on the opposite side to the arrow; the default one is the left side as determined for rivers. With hook'
the hook is reversed (it usually bends to the left side). Similarly one determines when bend left
or bend right
is needed.
please do this for me service
, it is for concrete questions).