问题
I am calling Graphviz from Java application using the Graphviz.java API and save the output graph to PDF file. I need to label some nodes with math subscripts and accents (for example $a_1$ or $\hat{a}$ in latex). I can survive with subscripts only.
is there anyway to do it? is this because of the API i'm using or I am missing something here.
I have tried b [label=<x<SUB>1</SUB>>]; but it doesn't work (though symbols like a [ label=<α>]; work and show up in the output file).
回答1:
According to their documentation,
NOTE:The font markups for bold, italic, underlining, subscript and superscript (
<B>,<I>,<U>,<SUB>;and<SUP>) are only available in versions after 14 October 2011, and are currently only available via the cairo and svg renderers. In addition, the horizontal and vertical rules (<HR>and<VR>) are only available in versions later than 8 July 2011.
Are you sure you are using either of those versions?
来源:https://stackoverflow.com/questions/17669014/create-graphviz-labels-with-subscripts-from-java-application