I need to represent a commutative diagram. The following code works. Is there a way to modify it in order to have longer arrows?

A \arrow[transform canvas={yshift=.5ex}]{r}{f}  \arrow[transform canvas={xshift=.5ex}]{d}{g} & B 
\arrow[transform canvas={yshift=-.5ex}]{l}{h} \arrow[transform canvas={xshift=-.75ex}]{dl}{} \\
C \arrow[transform canvas={xshift=-.5ex}]{u}{r} \arrow[transform canvas={yshift=-.75ex}]{ur}{}

2 Answers 2


Use the sep key. The input can also be simplified.



A \arrow[r,shift left,"f"] \arrow[d,shift left,"g"] &
B \arrow[l,shift left,"h"] \arrow[dl,shift left] \\
C \arrow[u,shift left,"r"] \arrow[ur,shift left]


enter image description here


I added my MWE using the xy package....but with the same tips of @egreg :-) :-). The code is more hard than tikz-cd. Using the parameter <.5ex> you can increase or decrease the distance of the double arrows, and with R=1.5cm@C=2cm you can change the lenght of the row and the column.

 A \ar@<.5ex>[r]^{f} \ar@<.5ex>[d]^{g}& \ar@<.5ex>[l]^{h} B\ar@<.5ex>[dl]\\
 C \ar@<.5ex>[u]^{r} \ar@<.5ex>[ur] & 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .