Mgarvey
Mgarvey

Reputation: 91

Graphviz Subscript

I am trying to get graphviz up and working and I desperately need subscripts in my node labels. Unfortunately, looking through endless posts with people on similar problems it seems I fit into all the proposed solutions and yet still not working. Heres what I have for the code:

 digraph G{
execute [label=<ex<SUB>2</SUB>>];
main -> parse -> execute;
main -> init;
main -> cleanup;
init -> make_string;
main -> printf;
}

Also run this:

$ dot -Tps:cairo -v test.gv -o out.ps

and as output:

> dot - graphviz version 2.26.3 (20100126.1600)
Activated plugin library: libgvplugin_pango.so.6
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_dot_layout.so.6
Using layout: dot:dot_layout
Using render: cairo:cairo
Using device: ps:cairo:cairo
The plugin configuration file:
    /usr/lib/graphviz/config6
        was successfully loaded.
    render  :  cairo dot fig gd map ps svg tk vml vrml xdot
    layout  :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout  :  textlayout
    device  :  canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg pdf plain plain-ext png ps ps2 svg svgz tk vml vmlz vrml wbmp x11 xdot xlib
    loadimage   :  (lib) eps gd gd2 gif jpe jpeg jpg png ps svg
Error: Unknown HTML element <SUB> on line 1 
fontname: "Times-Roman" resolved to: (ps:pango  Times Roman,) (PangoCairoFcFont) "DejaVu Sans 14" 
in label of node execute
network simplex:  7 nodes 6 edges maxiter=2147483647 balance=1
network simplex: 7 nodes 6 edges 0 iter 0.00 sec
mincross: pass 0 iter 0 trying 0 cur_cross 0 best_cross 0
mincross G: 0 crossings, 0.00 secs.
network simplex:  13 nodes 16 edges maxiter=2147483647 balance=2
network simplex: 13 nodes 16 edges 1 iter 0.00 sec
routesplines: 6 edges, 18 boxes 0.00 sec
Using render: cairo:cairo
Using device: ps:cairo:cairo

I m not quite familiar with cairo or svg renders and am quite unsure if this is packaged with graphviz or if it is a separate library all together. I have Ubuntu 12, installed graphviz via apt-get. Any help at all would be appreciated.

Thanks

Upvotes: 4

Views: 4870

Answers (2)

north at graphviz
north at graphviz

Reputation: 449

Another likely problem is that some SVG renderers (inkscape?) don't seem to recognize the baselineskip construct used for subscripts in the graphviz -Tsvg (which is -Tsvg:core:core) output.

Please try -Tsvg:cairo. This may work because the cairo renderer does its own low-level glyph placement and doesn't rely on those pesky high-level features in SVG.

Stephen North

Upvotes: 2

marapet
marapet

Reputation: 56446

Here's why - from the graphviz documentation:

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

Your version is 2.26.3 which is from January 2010.

I recommend to upgrade.

See also this answer to a similar question

Upvotes: 4

Related Questions