[Xy-pic] Vertical alignment in xymatrix

Michael Abbott michael at araneidae.co.uk
Mon Mar 3 14:24:16 CET 2003

I've got a couple of problems with controlling vertical alignment with
xymatrix, and I'd like to know if there are any solutions.

Firstly, I'd like the option (in fact, I'd rather it were the default) for
the entries in each cell to be aligned on the equation centre line rather
than being vertically centred.

Consider the example:
	\xymatrix{-^X \ar[r] & -_X}
Ideally the two - signs and the arrow should all be on a common
centre-line, but they're not (the difference is subtle but significant and
annoying, and gets worse the bigger the sub- and superscripts get).

Can I do anything about this?

Secondly, I'd also like the option to control where the baseline of the
entire \xymatrix{} expression is, so that I can write, for example:

	          A'--> B'
	          |     |
	Blah blah A --> B and so on

and have the *bottom* line of the matrix alined up with the body of the
text.  At present I can line up with the *top* line, or put \vcentre{}
around the whole thing, but I can't figure a way to align the matrix on
any other baseline.
    (For reference, a genuinely practical application is putting the
trailing punctuation after a diagram in the right place.  Ideally it
should be aligned on the *bottom* line.)

These two alignment issues have been bugging me for ages, so I'll be glad
of any advice!

Many thanks,
	Michael Abbott

More information about the Xy-pic mailing list