# Shorten or extend xypic arrows

In an xypic or xymatrix diagram, is it possible to specify that an arrow should only cover part of the distance it normally would? In other words, for an arrow \xymatrix{ A \ar[r] & B }, or between two nodes in a more complex diagram \ar@{>=>}"A";"B", I would like to specify that e.g. it should start at 0.3 of the distance from A to B, and end at 0.85 of the distance to B.

(This would be similar to what the \xymatrix{ A \ar[r(0.6)] & B } notation does, except that that only shortens the arrow on the target end, not the source.)

-
Well, try tikz-cd instead. It's easier to shorten arrows in tikz. – Leo Liu Feb 27 '13 at 15:31
@LeoLiu: I like tikz-cd, but I have co-authors who prefer to stick to xymatrix where possible. – Peter LeFanu Lumsdaine Feb 27 '13 at 22:15

One way to do this is to first typeset an empty arrow \ar@{}[r] and label the required positions. For example ^(0.4){}="a" places an empty label named "a" at 0.4 of the way along the arrow. If you have set up labels "a" and "b" this way, then \ar "a";"b" will draw an arrow between them.

\documentclass{article}

\usepackage[all]{xy}

\begin{document}

Normal arrow
$$\xymatrix{ A \ar[r] & B }$$
Shortened arrow
$$\xymatrix{ A \ar@{}[r]^(.25){}="a"^(.75){}="b" \ar "a";"b"& B }$$

\end{document}

-
I tried this in LyX and got <pos> "a" not defined" and <pos> "b" not defined. How do I fix it? – Exterior Dec 6 '14 at 14:08
@Exterior Sounds like a LyX specific problem. You should ask a separate question. – Andrew Swann Dec 6 '14 at 21:02