5

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!

Werner
  • 603,163
mathbekunkus
  • 1,389
  • 2
    Would you be able to provide a complete (minimal) document that reproduces these problems? – Werner Feb 03 '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 http://texblog.net/latex-archive/maths/pgf-tikz-commutative-diagram/. And TikZ provides many arrows and styles. – Stefan Kottwitz Feb 03 '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? – mathbekunkus Feb 03 '12 at 23:02

1 Answers1

3

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}
egreg
  • 1,121,712
  • Very much obliged, egreg! It works perfectly. It'd be nice to know why it happens, don't you think? Cheers!!! – mathbekunkus Feb 06 '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 06 '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. –  Jul 26 '12 at 17:02