[Xy-pic] Ensuring arrow labels fit, in xymatrix.

Ross Moore ross at ics.mq.edu.au
Thu May 11 01:53:51 CEST 2006

Hi Scott,

On 11/05/2006, at 8:08 AM, Scott Morrison wrote:

> I know this is a dumb question, but I can't seem to find any mention
> in the xyguide.
> How do I ensure that column spacing takes into account long arrow
> labels? For example, if I have
> \xymatrix{1 \ar[r]^{aaaaaaaaaaaaaaa} & 2 \ar[r]^{b} & 3}

Put in an extra column containing just some blank space.
Make your arrows span that extra column.

\xymatrix{1 \ar[rr]^{aaaaaaaaaaaaaaa}&\hspace{2cm}& 2 \ar[r]^{b} & 3}

Alternatively, use  \xygraph  and its more flexible syntax,
rather than  \xymatrix .

> the label aaaaaaaaaaaaaaa extends beyond the ends of the arrow. I want
> to enlarge the gap between columns 1 and 2, either by end or
> automatically depending on the size of the arrow labels.

Doing it automatically isn't so easy.
You could try something like:

\xymatrix{1 \ar[rr]^{\mylabeli}&\phantom{{\scriptstyle\mylabeli}}%
    & 2 \ar[r]^{b} & 3}

> Similarly; how do I force the row spacing between 2 rows to become
> smaller or larger, without affecting the row spacing in the rest of
> the matrix?

Adding extra rows, with  \strut  or  \vrule width=0pt height=???
(or \phantom s) to force the desired amount of extra space.

> Thanks, Scott Morrison

Hope this helps,


Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114

More information about the xy-pic mailing list