title: Latex equation in Graphviz digraph in Python Sphinx doc
body: <p>I want to create a sphinx doc with a Graphviz graph that has a node with LaTeX equation.</p>
  <p>I tried:</p>
  <pre class="lang-py prettyprint-override"><code>r&quot;&quot;&quot;
  .. graphviz::
  
     digraph foo {
        a_1 [label=&quot;$x_{0}$&quot;];
        a_1 -&gt; &quot;baz&quot;;
     }
  &quot;&quot;&quot;
  </code></pre>
  <p>But the label in the resulting graph is <code>$x_{0}$</code> instead of <em>x</em><sub>0</sub>.</p>
  <p>The extensions specified in the <code>conf.py</code> of the Sphinx doc are:</p>
  <pre class="lang-py prettyprint-override"><code>extensions = [&quot;sphinx.ext.autodoc&quot;, &quot;sphinx.ext.napoleon&quot;,
                &quot;sphinx.ext.mathjax&quot;, &quot;sphinx.ext.graphviz&quot;]
  </code></pre>
  <p>Related:</p>
  <p><a href="https://stackoverflow.com/questions/39334738/improve-positioning-of-subscript-and-superscript-on-node-labels">Improve positioning of subscript and superscript on node labels</a></p>
  <p>dot2tex <a href="https://stackoverflow.com/questions/35830447/python-graphs-latex-math-rendering-of-node-labels">Python Graphs: Latex Math rendering of node labels</a></p>