Use Graphviz within *TeX

You can use dot2tex, which is available from CTAN.


You can use the graphviz package.

\documentclass{standalone}
\usepackage[pdf]{graphviz}

\begin{document}
   \digraph{abc}{
      rankdir=LR;
      a -> b -> c;
   }
\end{document}

enter image description here

More examples here.


Here's how you can do it using the dot2tex package:

\documentclass{minimal}
\usepackage[autosize]{dot2texi}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\begin{document}
\begin{dot2tex}[neato,mathmode]
digraph G {
node [shape="circle"];
a_1 -> a_2 -> a_3 -> a_4 -> a_1;
}
\end{dot2tex}
\end{document}

However, this is an old package, and it's possible that other options are better (e.g. @user1491229's suggestion of the graphviz package).

Tags:

Graphs