CDSoft / pp

PP - Generic preprocessor (with pandoc in mind) - macros, literate programming, diagrams, scripts...

Home Page:http://cdelord.fr/pp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inserting LaTeX in Graphviz graph

sbeleidy opened this issue · 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
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~