Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am currently working on a project to create a translator from Frank Drewes' graph style into TikZ.

As an example, I am trying to recreate the following diagram from the graph style manual into a TikZ diagram.

(See Example graph style diagram)

enter image description here

The code for the above in Graph style is:

\edge{Sq}{Ro} \diredge{Ro}{Te}

Most of these commands are easy to translate; however, I am having a lot of trouble with the "loopedge" and "dirloopedge" commands.

The description of the "loopedge" command from the manual is as follows:


A loop at node name. The coordinates (x1,y1) and (x2,y2) are interpreted as relative coordinates of the endpoints of two edge halves starting in name. During drawing, these are connected by a curve to obtain a loop.

There does not seem to be a command anything like this in TikZ and, in fact, drawing loops seems to be really difficult. My problem is further compounded by a lack of documentation in the graph style manual as to how the connecting curve is actually produced.

Can anyone help me?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

I'm not sure exactly what method is used to obtain the curve drawn by \dirloopedge (for some reason, the asymmetric support points in your example seem to yield a symmetric curve). Below is a macro that has the same form as that in "Graph Style".

It draws a straight line from the start node to the first support point and from the second support curve to the start node, with a curve between the two support points with the out and in angles equal to the angles of the straight line segments. You might want to adjust the looseness parameter, which determines the radius of the curve.



    \draw [-latex] (#1) -- +(#2,#3) to [out=\outangle,in=\inangle,looseness=5]  +(#4,#5) -- (Ro);


\node (Ro)  at (0,0.5) [fill,circle,inner sep=2pt] {};



dirloopedge with TikZ

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.