# Question about arrow in diagram

how i can write using latex to find this:

but with long arrows

Thank you.

• Have a look at either the xy package or the tikz-cd package – daleif Sep 7 '14 at 17:35

It's quite easy with tikz-cd.

1. The first bit is the arrow direction: d for “down”, r for “right” and so on.

2. The label on an arrow is by default on the left side (in the arrow direction); with swap we place it on the other side

3. Similarly, shift left refers to a movement towards the left side of the arrow (in the arrow direction); shift right does the same in the other side.

4. The default value of row sep is 1.8em, while column sep is 2.4em; play with them until you're satisfied.

5. The ^{\vphantom{\prime}} is used in order to have the two iotas at the same level.

Here's the code.

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

\begin{document}
$\begin{tikzcd}[row sep=3em,column sep=4.5em] C_{p-1}(X) \arrow[dr,"K_{p-1}"] & C_{p}(X) \arrow[l,swap,"\partial"] \arrow[d,shift right=.3em,swap,"\iota^{\vphantom{\prime}}_{p}"] \arrow[d,shift left=.3em,"\iota'_{p}"] \arrow[dr,"K_{p}"] \\ & C_{p}(X\times[0,1]) & C_{p+1}(X\times[0,1]) \arrow[l,swap,"\partial"] \end{tikzcd}$
\end{document}


Alternatively, you can use the older Xy-pic package.

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

\begin{document}
$\xymatrix@R=3em@C=4.5em{ C_{p-1}(X) \ar[dr]^{K_{p-1}} & C_{p}(X) \ar[l]_{\partial} \ar@<-.3em>[d]_{\iota^{\vphantom\prime}_{p}} \ar@<.3em>[d]^{\iota'_{p}} \ar[dr]^{K_{p}} \\ & C_{p}(X\times[0,1]) & C_{p+1}(X\times[0,1]) \ar[l]_{\partial} }$
\end{document}


The syntax is a bit different, but the ideas are the same.

• It makes me an error with this usepckage – Vrouvrou Sep 7 '14 at 19:52
• @Vrouvrou What TeX distribution are you using? – egreg Sep 7 '14 at 19:54
• Im using texmaker – Vrouvrou Sep 7 '14 at 20:02
• @Vrouvrou Texmaker is just the editor; what's the first line in the .log file you get after compiling? You can try the Xy-pic version, but I'd recommend using tikz-cd if possible. – egreg Sep 7 '14 at 20:04
• l/texlive/2011/texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfb></usr/local/t – Vrouvrou Sep 7 '14 at 20:05

You also can easily do such an homotopy diagram with the psmatrix environment (from the pst-node package. The syntax is different from tikz-cd: you first describe the matrix of nodes, then the connections between these nodes. The nodes can have names, but you can use their i,j position in the matrix.

It can be compiled with pdflatex if you set the switch --enable-write18 (MiKTeX)or--shell-escape (TeX Live, MacTeX):

\documentclass[pdf]{report}
\usepackage{pst-node}

\begin{document}

$\psset{arrows=->, nodesep=3pt, labelsep=3pt, colsep=1.2cm, rowsep=1.8cm} \begin{psmatrix} C_{p-1}(X) & C_p(X) \\% & C_p(X × [0,1])&C_{p + 1}(X × [0,1]) % \ncline{1,2}{1,1}\nbput{∂} \ncline{2,3}{2,2}\nbput{∂} \ncline{1,1}{2,2}\naput[labelsep =0pt]{K_{p-1}} \ncline{1,2}{2,3}\naput[labelsep =0pt]{K_p} \ncline[offset=- 0.8ex]{1,2}{2,2}\nbput{i_p}\ncline[offset=0.8ex]{1,2}{2,2}\naput{i'_p} \end{psmatrix}$
\end{document}


• it makes me error, i'm using texmaker – Vrouvrou Sep 7 '14 at 20:02
• Did you try the latex + dvips way? I guess the mentioned switch is not enabled on your system. You should configure TeXmaker (Options menu) with this line for pdflatex:pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex`. – Bernard Sep 7 '14 at 20:21