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.

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.)

share|improve this question
    
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

1 Answer 1

up vote 4 down vote accepted

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.

Sample output

\documentclass{article}

\usepackage[all]{xy}

\begin{document}

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

\end{document}
share|improve this answer

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.