pp icon indicating copy to clipboard operation
pp copied to clipboard

Inserting LaTeX in Graphviz graph

Open sbeleidy opened this issue 7 years ago • 0 comments

What is the best way to insert LaTeX equations into my GraphViz graphs? I'm having trouble getting that to work in a simple way.

It seems the best way might be to use dot2tex in LaTeX - is that correct?

Ideally, I can work with this in markdown by adding some option. Is something similar supported?

Example based on dot2tex:

!twopi(img/graphviz-maths-example)(Add some mathematical equation)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
digraph {
    d2toptions ="-tmath";
    O [label="x^2"]
    O -> {A B C D}
    A -> B
    B -> C
    C -> A
    D -> O
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sbeleidy avatar Jun 08 '18 17:06 sbeleidy