Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a very annoying issue with xypic. I'm trying to typeset an exact sequence, one of which morphisms is the inclusion, so I'd like to use the inclusion arrow ↪.

The problem is that when I use ANY style in the xypic@1 environment, I get several errors. This is the code I use:

\xymatrix@1{
0\ar[r]&{A)}\ar[r]&{B}\ar[r]&{C}\ar[r]& 0
}

and this runs harmoniously. The problems begin when I try to use any style (except @{} which is kind of frustrating). So the second arrow in my codeline would be like this: \ar @{^{(}->} [r] and I get the following errors, several times actually:

Xy-pic error: illegal : macro:->\es@use@shorthand > not valid. \xyerror@ ...#2}\fi \errmessage {Xy-pic error: #1}

! Extra }, or forgotten $. \objectbox #1->\hbox {$\m@th \objectstyle {#1} $}

Does anyone have any idea of why this occurs? I use TeXmaker 3 on opensuse 12.1 with TeXlive from TUG (not from the suse repos). Please, any help with be really appreciated!

share|improve this question
2  
Would you be able to provide a complete (minimal) document that reproduces these problems? –  Werner Feb 3 '12 at 22:22
    
Besides xy-pic, there's amscd and TikZ. I used the latter for typesetting exact sequences, perhaps have a look at texblog.net/latex-archive/maths/pgf-tikz-commutative-diagram. And TikZ provides many arrows and styles. –  Stefan Kottwitz Feb 3 '12 at 22:23
    
@Werner: that's going to be difficult. I have my thesis organized through several .tex files that I just input in a main file. One thing though: I've just noticed that the error does not occur when I create a new document. Any ideas? –  AdbekunkusMX Feb 3 '12 at 23:02
add comment

1 Answer

up vote 3 down vote accepted

I can reproduce the problem with this example:

\documentclass{article}
\usepackage[all]{xy}
\usepackage[spanish]{babel}
\begin{document}
\xymatrix@1{
  0\ar[r]&{A}\ar@{^{(}->}[r]&{B}\ar[r]&{C}\ar[r]& 0
}
\end{document}

However, the document compiles perfectly if Xy-pic is loaded after babel

\documentclass{article}
\usepackage[spanish]{babel}
\usepackage[all]{xy}
\begin{document}
\xymatrix@1{
  0\ar[r]&{A}\ar@{^{(}->}[r]&{B}\ar[r]&{C}\ar[r]& 0
}
\end{document}
share|improve this answer
    
Very much obliged, egreg! It works perfectly. It'd be nice to know why it happens, don't you think? Cheers!!! –  AdbekunkusMX Feb 6 '12 at 17:14
1  
@AdbekunkusMX The babel package treats specially some characters, notably ", but with the spanish option also others; Xy-pic is able to cope with these special characters provided they are set before it's loaded. –  egreg Feb 6 '12 at 17:17
    
This also solved a problem were no error message was displayed. I was looking for "xymatrix does not display special arrows" in google but did not find an answer, now that I got the error message I found this page with the right answer. Thank's. I placed this message in the hope that google find this page when the above text is typed or "xymatrix composed arrows fail" I know there exist a better way to do this, but I do not know how. –  user16962 Jul 26 '12 at 17:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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