[Xy-pic] moving the label away from the arrow

Ross Moore ross at ics.mq.edu.au
Tue Apr 17 20:12:20 CEST 2007


Hi Les, Baptiste, and others,

On 17/04/2007, at 4:21 PM, Les Saper wrote:

> On Apr 16,2007 18:31:42 +0100, Baptiste <calmes at math.jussieu.fr>  
> wrote :
>> I'm trying to use a label on an arrow, and to move it away from the
>> arrow (because it overlaps for some reason). I have seen that there
>> are options to change the positioning of the label along the arrow,
>> but I can't find anything to move it away. Am I missing something?
>> Here is the code in which I would like to move the label away:
>> $$\xymatrix{ A \ar@{}[r]|{\subseteq}^{a} & B
>> }$$
>
> The correct way to do this is to change the size of the label
> (not the actual size but the size that XyPic thinks it is).  Once
> you do this, XyPic will position it higher up to avoid overlap.
> For example,
>
> $$\xymatrix{ A \ar@{}[r]|{\subseteq}^*+{\labelstyle a} & B}$$
>
> Essentially the * indicates that you are adding modifiers to the
> label; here the modifier is + which causes it to grow.  You can
> change this to ++ which will make it grow more (and hence push
> the label up even higher).  Or you can specify +<dimen> to have
> it grow by a certain dimen(sion).  See the User's Guide for more
> information (and the reference manual for more detailed
> possibilities).  Note that I have included \labelstyle in the
> label.  This is because when you use *, any default style is
> ignored so we have to put it back in.

Yes, this is a good approach, but your description is not
quite correct.

When you do   ^*<object>  (or  _*<object>  or  |*<object> )
you are dropping an arbitrary <object> at the given position.

It is not assumed to be a <label> on the arrow, but can be
anything at all. Thus the default styles are determined by
  \objectstyle  rather than by  \labelstyle .
Hence if you want consistency with other labels then you
have to declared the \labelstyle , as in your example above.

Growing the size of the dropped <object> using the + <modifier>
indeed gives you a greater separation  of the object from its
anchor-point. But this extends the margin on all sides, so if
this object were to be the source or target of other arrows,
then these might not get close enough.

Here are other ways to shift the label, without affecting its size:


$$\xymatrix{ A \ar@{}[r]|{\subseteq}^*!/u6pt/{\labelstyle a} & B}$$

(Of course 6pt is far too much. Make it whatever you want.)


This next way uses the ^ perpendicular direction to the arrow,
so will also work when the arrow is slanted rather than horizontal.

$$\xymatrix{ A \ar@{}[r]|{\subseteq}^*!/^6pt/{\labelstyle a} & B}$$



>
> I hope this helps...

   ... this too.

Cheers,

	Ross Moore

>
> - Les Saper
>
> -----------------------------------------------------------
> Leslie Saper                    e-mail: saper at math.duke.edu
> Department of Mathematics       phone: 919-660-2843
> Duke University                 Fax: 919-660-2821
> Box 90320
> Durham, NC   27708-0320
> USA
>
>
>
>
> _______________________________________________
> xy-pic mailing list
> http://tug.org/mailman/listinfo/xy-pic

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