3

I want to create a sphinx doc with a Graphviz graph that has a node with LaTeX equation.

I tried:

r"""
.. graphviz::

   digraph foo {
      a_1 [label="$x_{0}$"];
      a_1 -> "baz";
   }
"""

But the label in the resulting graph is $x_{0}$ instead of x0.

The extensions specified in the conf.py of the Sphinx doc are:

extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon",
              "sphinx.ext.mathjax", "sphinx.ext.graphviz"]

Related:

Improve positioning of subscript and superscript on node labels

dot2tex Python Graphs: Latex Math rendering of node labels

bad_coder
  • 11,289
  • 20
  • 44
  • 72
hamster on wheels
  • 2,771
  • 17
  • 50

0 Answers0