# Custom commands for xymatrix paths

I would like to define a custom command to replace \ar@{->}r[d][l][llld]_-{\delta}[d][lld] in this bit of code:

$\xymatrix{ \cdots\ar@{->}[r] & H_n(X)\ar@{->}[r] & H_n(Y)\ar@{->}[r] & H_n(Z)\ar@{->}r[d][l][llld]_-{\delta}[d][lld] & \\ & H_{n-1}(X)\ar@{->}[r] & H_{n-1}(Y)\ar@{->}[r] & H_{n-1}(Z)\ar@{->}[r] & \cdots }$


I've tried \newcommand{\snake}[1]{\ar@{->}r[d][l][llld]_-{#1}[d][lld]}, but I keep getting errors with that. Does anyone know how to make custom commands to define xymatrix paths?

• Welcome to TeX.SX! Could you please add an example of the call to the new macro (even if not working)? Also add a \documentclass line and the packages necessary for compiling this code snippet. – egreg Nov 23 '13 at 22:09

% arara: pdflatex
\newcommand{\snake}[1]{\ar@{->}r[d][l][llld]_-{#1}[d][lld]}
$\xymatrix{ \cdots\ar@{->}[r] & H_n(X)\ar@{->}[r] & H_n(Y)\ar@{->}[r] & H_n(Z)\snake{\delta} & \\ & H_{n-1}(X)\ar@{->}[r] & H_{n-1}(Y)\ar@{->}[r] & H_{n-1}(Z)\ar@{->}[r] & \cdots }$