# [Xy-pic] Your tex problem (fwd)

Michael Barr barr at barrs.org
Wed May 7 11:11:22 CEST 2003

Here is a copy of the note I sent to Michael Abbott in response to his
recent request.

---------- Forwarded message ----------
Date: Wed, 7 May 2003 09:35:04 -0400 (EDT)
From: Michael Barr <barr at barrs.org>
To: michael at araneidae.co.uk

I am obviously prejudiced in favour of my own package (which is
essentially a front end to xy-pic, but uses the arrow option and
definitely not the matrix option that I find rather inferior in several
from ftp.math.mcgill.ca/pub/barr/diagxy.zip (which includes the package as
well as documentation/examples). At any rate, with some tinkering, I
produced the following, which looks pretty good.

\documentclass{article}
\input diagxy
\begin{document}
\def\mathbox#1{\hbox{$#1$}}

$$\bfig \square/>>><-/<1300,600>[\phantom{=BBBB}AAAA=BBBB\vtop{ \mathbox{CCCC}\mathbox{\kern 12pt\simeq} \mathbox{DDDD}}FFFFEEEE;fghk] \efig\phantom{=BBBB}$$

\end{document}

Note the \phantom at the end.  This is to compensate for the way the upper
left corner was moved over.  Without this, the picture will not be
centred.  I do not know any other way of doing this; there is no way I
know of to prescribe a baseline for an hbox.

The kern of 12pt was just trial and error.  I don't know a good way of
telling a vbox (or a vtop, in this case) to fill out to the width of the
remaining hboxes.  Without the vtop, the upper right node will just stick
up and you could get it centred with a \vcenter box.

The width of 1300 and height of 600 were just done by eye.  I despair of
doing things like that automatically.

Finally, you could obviously use \hbox{$...$} instead of \mathbox.  I had
forgot the \$ and rather than insert them I just made a global change.

Happy texxing,

Michael Barr

`