Display labels in line with the edge when using Graphviz

Using dot2latex allows you to specify lblstyle attribute. The value of lblstyle is used by PGF/TikZ in pdf generation.

One can specify parallel labels like this:

digraph G {
    edge [lblstyle="above, sloped"];
    a -> b [label="ab"];
    b -> c [label="bc"];
    c -> a [label="ca"];
}

To generate the pdf

$ dot2tex --tikzedgelabel file.dot > file.tex
$ pdflatex file.tex

The result is

enter image description here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)