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.

Recently I have upgraded my TeX installation to TeX Live-2012 from TeX Live-2009. Now \xymatrix is misbehaving. The behavior affects both Mac OS X and Ubuntu Linux 12.04 installations.

For example, the straightforward code

\[
  \xymatrix{
  F \ar[r]^-v \ar[dr]_-{T v} & V \ar[d]^-T \\
  & W }
\]

used to label the arrows correctly, now has the bizarre effect of

\[
  \xymatrix{
  F^v_{T v} \ar[r] \ar[dr] & V^T \ar[d] \\
     & W }
\]

Here's my preamble:

\documentclass[10pt]{letter}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{breqn}
\usepackage[urlcolor=blue,linkcolor=blue,citecolor=blue]{hyperref}
\usepackage[all]{xy}

Has anyone encountered this unexpected behavior?

share|improve this question
1  
Welcome to TeX.sx! Why should the syntax \usepackage[all]{xy} be obsolete? It isn't. The breqn package is the culprit. –  egreg May 23 '13 at 20:58
    
Edited. If you know that some syntax isn't obsolete and say so explicitly, what is the point of asking why it should be? –  F Lengyel May 24 '13 at 5:17
add comment

1 Answer

up vote 5 down vote accepted

You don't say from what TeX distribution you upgraded. The breqn package has undergone big changes, one of which, unfortunately, makes it not to cooperate well with Xy-pic.

You can return to the normal behavior with some trick:

\documentclass[10pt]{letter}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{breqn}
\usepackage[all]{xy}
\usepackage{etoolbox}

\usepackage[urlcolor=blue,linkcolor=blue,citecolor=blue]{hyperref}

%%% breqn changes the category code of ^ and _
%%% in a way that breaks Xy-pic
\newcommand{\Xycatcodes}{\catcode`\^=7 \catcode`\_=8 }
\makeatletter
\preto\xymatrix@setup{\Xycatcodes}
\makeatother

\begin{document}
\[
  \xymatrix{
  F \ar[r]^-v \ar[dr]_-{T v} & V \ar[d]^-T \\
  & W }
\]
\end{document}

It's possible that other characters give problems, but this should work. The change is localized to \xymatrix so it should be possible to use it in breqn environments.

The syntax

\usepackage[all]{xy}

is not obsolete at all. It's the other way around: one should never use

\input xy
\xyoption{all}

in LaTeX.

share|improve this answer
    
The last remark is incorrect--it is permissible to use the earlier form in Latex 2e, e.g., if you want backwards compatibility with v2. –  F Lengyel May 24 '13 at 5:32
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.