Dot2tex v. 1.5.0 released
- Published 2006-10-22 (1 year, 6 months ago)
I'm pleased to announce a new release of dot2tex. The new version introduces features that makes the tool much more useful and flexible. Highlights of the new release are:
- The style attributes is now passed to the rendering backend. This offers a powerful and flexible way of customizing the output.
- Improved template system.
- A handful of new and useful command line options.
I have also created a gallery of the examples in the source distribution. From the gallery you can download the DOT source and the generated LaTeX and PDF output.
Styles
Version 1.5.0 of dot2tex introduces a powerful and flexible style mechanism for customizing the look and feel of graphs. Each graph, node and edge element can have a style attribute. Only a few styles are currently supported by Graphviz, but styles are passed to the rendering backend. The following example shows how interesting visual results can be achieved with the PGF/TikZ backend.
graph G {
node [shape=circle, fixedsize=True, width="0.2",
style="ball color =green", label=""];
edge [style="snake=zigzag, green"];
a_1 -- c -- a_2;
c [style="ball color=black"];
edge [style="snake=snake, blue"];
node [style="ball color = red", label=""];
a_3 -- c -- a_4 --a_3;
}
Rendered with
$ fdp -TXdot ball.dot | dot2tex.py -fpgf -s > balls.tex
the resulting graph will look like this:
Go to this example's gallery entry to download a PDF version. In the gallery and in the documentation you will find more examples on how to customize graphs with styles.
Future plans
Dot2tex is already quite useful. However, there are still a few
features missing, like for instance support for the fontcolor
attribute. There is also still room for improvements in the template
system, and the generated code is more bloated than necessary.
My next plan is to implement a few simpler and more application specific versions of the backends. PGF/TikZ for instance, has elegant libraries for drawing nodes, edges, automata and such. This can be utilized to create more compact and elegant code.
I appreciate all feedback on how to improve dot2tex!


Comments
Hi Kjell, having created a small graphical LaTeX frontend (just for a specific kind of diagrams) in Java, I found all this very interesting. Question, though: the above example (starting with "Graph G") doesn't specify any coordinates for the balls. So I wondered whether they are placed automatically, or what if one wanted them to appear somewhere else...
@Jan
The graph nodes are placed automatically by Graphviz. That is the main reason for using Graphviz and dot2tex. You have however, some control of how nodes are placed, and you can also explicitly set the coordinates using the pos attribute.
Dummy comment.
Post a comment
Markdown syntax enabled