I intend to generate this sketch using tikz, but was unable to do so. I was trying to fiddle with the following code:
\documentclass{article}
\usepackage{amsmath,mathtools}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A \arrow[rd] \arrow[r, "\phi"] & B \\
& C
\end{tikzcd}
\end{document}
I need some help here. Also a good reference for tikz would be appreciated, specifically, I am not able to understand the function of "&" in tikz environment.
Best Answer
tikz-cd
documentationYou have to think on your diagram as an array, with rows and columns. In your case, 2 rows and 4 columns.
So, at position
(i,j)
you can start an arrow pointing to another position(k,l)
, where you specify if the ending position isleft
,right
,up
ordown
, or even combinations of those.In your example, and arrow from
B
toE
should berd
(right and down).Observe that to create cells in the array you change columns with
&
and change rows with\\
.As usual, it is easy to change colours also, for example,
\arrow[rd, red]
.