[Tex/LaTex] Increasing the length of arrows in latex

arrowscommutative-diagrams

enter image description here

Attached is the code I'm using for drawing commutator diagrams. I want to increase the length of the arrows. How can I do that.

$$
\begin{xy}\xymatrix{
 E
  \ar[r]^*{e} 
&
 X
  \ar[r]<4pt>^*{s}
  \ar[r]<-4pt>_*{t} 
&
 Y \\
 Z
  \ar[u]<4pt>^*{\gamma_1}
  \ar[u]<-4pt>_*{\gamma_2}
  \ar[ur]_*{e \circ \gamma_1 = e \circ \gamma_2}
}\end{xy}
$$

Best Answer

It's quite easy:

\documentclass{article}
\usepackage{amsmath}
\usepackage[all,cmtip]{xy}

\begin{document}

\[
\xymatrix@R+1pc@C+1pc{
  E \ar[r]^*{e} & X  \ar[r]<4pt>^*{s} \ar[r]<-4pt>_*{t} & Y \\
  Z \ar[u]<4pt>^*{\gamma_1} \ar[u]<-4pt>_*{\gamma_2}
    \ar[ur]_*{e \circ \gamma_1 = e \circ \gamma_2}
}
\]

\end{document}

With @R+1pc I tell Xy-pic to increase by 1pc (12pt) the interrow space; similarly, @C+1pc increases the intercolumn space. You'd get the same result with

\xymatrix@+1pc{

which would apply the setting to both the interrow and intercolumn spaces. Specifying them separately allows for finer control.

enter image description here

Note you should use \[...\] and not $$, see Why is \[ ... \] preferable to $$ ... $$? You also need no xy environment.

The same with tikz-cd:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}

\begin{document}

\[
\begin{tikzcd}[column sep=3em,row sep=3em]
  E \arrow[r,"e"] & X \arrow[r,shift left=.7ex,"s"] \arrow[r,shift right=.7ex,swap,"t"] & Y
  \\
  Z \arrow[u,shift left=.7ex,"\gamma_1"] \arrow[u,shift right=.7ex,swap,"\gamma_2"]
    \arrow[ur,swap,"e \circ \gamma_1 = e \circ \gamma_2"]
\end{tikzcd}
\]

\end{document}

enter image description here