4

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
1

Your example works for me. Please try the following code:

% arara: pdflatex

\documentclass{article}
\usepackage[all, pdf, cmtip]{xy}
\newcommand{\snake}[1]{\ar@{->}`r[d]`[l]`[llld]_-{#1}`[d][lld]}

\begin{document}
\[\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
}\]
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.