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?


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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