TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working with LyX.

I would like to change the length of an arrow from a vertex to itself. I would like to make the arrow stretch longer up before returning down to the encircled vertex. The code I have been using so far, inside the \xymatrix in the LyX Math-box, is:


How should this code be modified in LyX in order to lengthen the arrow?

share|improve this question
up vote 4 down vote accepted

As canaaerus says the control points option is the way to go. To reproduce the ul direction use a point of the form (-x,x) and for the ur direction (x,x). The standard size is produced with x roughly 10. Now with the correct syntax you can write

\usepackage[arrow, matrix, curve]{xy}

\( \begin{xy}\xymatrix{ e\ar @`{(-10,10),(10,10)}  }\end{xy} \qquad
    \begin{xy}\xymatrix{ e\ar @`{(-20,20),(20,20)}  }\end{xy} \)


and get

Selfarrow sample

To make this narrower, reduce the size of the x-coordinates of the control points

\( \begin{xy}\xymatrix{ e\ar @`{(-10,20),(10,20)} } \end{xy} \)

Narrow selfarrow

See the manual of xypic, particularly the section on curves, for more information about control points.

Note that if you wish to place such arrows at a different node of your \xymatrix then you should be careful about absolute vs. relative coordinates, one way to deal with this is to package the node into an \xybox. Here is an example, including the node formatting in your original question:



\( \begin{xy}\xymatrix{ \xybox{ *=+[o][F]{e}\ar @`{(-10,10),(10,10)} } &
   \xybox{ *=+[o][F]{e}\ar @`{(-20,20),(20,20)} } }\end{xy} \) 


Matrix example

and here is a further example demonstrating that xypic treats these nodes correctly in that arrows point to the circled node:



    \xybox{ *=+<12pt>[o][F]{e}\ar @`{(-10,10),(10,10)} }
    \ar@{.>}[rd]_q &
    \xybox{ *=+<12pt>[o][F]{g}\ar @`{(-20,20),(20,20)} } \ar[d]^p \\
    & \xybox{ *=+<12pt>[o][F]{f}\ar @`{(-10,-20),(10,-20)}|a }


Sectond matrix example

Notice that I have used +<12pt> to get larger circles around the nodes.

share|improve this answer
Andrew, thanks a lot for your answer! It's very helpful! :) – Shlomi A Aug 24 '12 at 9:36
This is fantastic, and it can be made even better. :) To use relative coordinates, you can just write "\ar@`{p+(-10,10),p+(10,10)}", because "p" is parsed as the coordinates of the source of the arrow (see paragraph 24q of the XY-pic reference manual). – Vectornaut Aug 18 '13 at 3:08
@Vectornaut That is a very useful way of specifying these relative coordinates without packing up in a box. – Andrew Swann Aug 18 '13 at 9:11
I'm glad you like it! – Vectornaut Aug 19 '13 at 5:18

First of all e\ar@(ul,ur) seems to have the same effect for me as your example. To make it into a complete MWE:

\usepackage[arrow, matrix, curve]{xy}


\[ \begin{xy}\xymatrix{ e\ar@(ul,ur) }\end{xy} \]


Now I think the problem can be solved by putting explicit curve control points. Compare 24q in the XY-pic Reference Manual. Then the syntax should look like e\ar@'{a,b} where a and b are control points which are to the upper left and upper right, but sufficiently far away.

Unfortunately I'm not familiar enough with this function yet.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.