1

I am using XY-pic to draw a simple graph with a double curved arrow (a simple version of exercise 5 in the xyguide). It appears that when the entries are different in length, the curved arrows get asymmetric. The following sample shows the issue: in the first row, the curved arrows are symmetric (because the entries have the same length); in the second row, the curved arrows are asymmetric.

\documentclass{article}
\usepackage[all]{xy}
\begin{document}
\xymatrix{%
X\ar@/^/@{->}[rr]&&X\ar@/^/@{->}[ll]\\
XXXXX\ar@/^/@{->}[rr]&&X\ar@/^/@{->}[ll]
}
\end{document}

Is there a way to render the curved arrows symmetric ?

3 Answers 3

2

\phantom could be a fast fix:

\documentclass{article}
\usepackage[all]{xy}
\begin{document}
\xymatrix{%
{X}\ar@/^/@{->}[rr]&&{X}\ar@/^/@{->}[ll]\\
{XXXXX}\ar@/^/@{->}[rr]&&{X\phantom{XXXX}}\ar@/^/@{->}[ll]
}
\end{document}

Output:

enter image description here

As you can see it doesn't center.

2
  • Just leaving my answer as a starting idea because I don't see other answers yet. I will possibly delete it later.
    – koleygr
    Commented Oct 14, 2017 at 18:16
  • Thanks. Indeed, but now the row is unbalanced what can be an issue if the row is put in an equation environment, if it belongs to a sequence. Commented Oct 14, 2017 at 18:20
1

Not an Xy-pic answer, but a tikz-cd one, which shows it's rather easy to cope with the problem.

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}[column sep=huge]
  X \arrow[r,bend left=12] & X \arrow[l,bend left=12]
  \\
  XXXXX
  \arrow[
    r,
    bend left=12,
    start anchor={[yshift=.5ex]east},
    end anchor={[yshift=.5ex]west},
  ]
  &
  X
  \arrow[
    l,
    bend left=12,
    start anchor={[yshift=-.5ex]west},
    end anchor={[yshift=-.5ex]east},
  ]
\end{tikzcd}

\end{document}

enter image description here

0

Here's what I came up with:

\xymatrix{%
X\ar@/^/@{->}@<.5ex>[]+R;[rr]+L&&X\ar@/^/@{->}@<.5ex>[]+L;[ll]+R \\
XXXXX\ar@/^/@{->}@<.5ex>[]+R;[rr]+L&&X\ar@/^/@{->}@<.5ex>[]+L;[ll]+R
}

The key is to anchor each of the anchors at the right ([]+R;) or left ([]+L;) of the source node and the destination node ([rr]+L or [ll]+R). Then to stop the two arrows from hitting exactly the same point, offset them a little (@<.5ex>).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .