[Xy-pic] Delicate alignment problem.

Ross Moore ross at ics.mq.edu.au
Tue May 13 01:23:48 CEST 2003

On Mon, 12 May 2003, Michael Abbott wrote:

> >  What is wrong with using   *+!L{{}=BBBB}="BB"   to get the margin ?
> >
> > (which is different to  *!L+{{}=BBBB}="BB"  by the way)
> > Does the extra slight shift to the right upset the diagram ?
> Alas, yes, that's the problem.  I've tried that one, and it creates an
> unwanted extra gap between AAAA and the =.

But you know how big it is:  \objectmargin
 (or is it  1/2 * \objectmargin )
so shift left by this amount before putting the  {{}=BBBB}.

> Obviously I'm trying to solve a generic problem here.  In this particular
> case the problem is one of placing two boxes side by side while still
> retaining full independent command over the resulting boxes.
> Even if we fixed this with an extra sideways shift, eg
> 	-\whatever *+!L{{}=BBBB}="BB"
> because the centre point is still in the wrong place the generic problem
> remains open.  For example, I might like to draw the following:
> 	        |
> 	        v
>          ^
> 	 |

This isn't a problem, since you can add the margin in one direction only
--- in this case above and below, but not left-right.


But you could do it in a different way, using \phantom
and the Xy-pic 'skew' operator (e.g. !C to center a <POS>)
to adjust the reference-point within a known rectangle;

  % establishes the left target <POS> without putting any ink
   !{+L*+!L{AAAA = BBBB}}
  % places the ink aligned at the left end
  % creates a target <POS> of the correct size and alignment.

Note how the !{.....}  kernel escape can be used within \xygraph
to help do a delicate alignment or positioning.

> If I can't give BBBB back its proper centre then I can't do the right hand
> arrow.

But you *can* give it back that alignment, using the ! skew operator.

> (What should \whatever be in the above, by the way?  Obviously it should
> be an offset equal to the value added on each side by +.)
 Yes, that's one way to skin this cat.

Hope this helps,

	Ross Moore

More information about the Xy-pic mailing list