I am trying to use dot2texi package in Lyx to generate graphs, and I include the following in the preamble of the document:
\usepackage[all]{xy}
\usepackage{dot2texi}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage{pgfplots}
% recommended as of Pgfplots 1.3:
\pgfplotsset{compat=newest}
And I insert a block of Tex code inside my Lyx document:
\begin{dot2tex}[neato,options=-tmath]
digraph G
{
node [shape="circle"];
a_1 -> a_2 -> a_3 -> a_4 -> a_1;
}
\end{dot2tex}}
as taken from the example here: http://www.fauskes.net/code/dot2tex/documentation/#the-dot2texi-latex-package
However, when I view the document in PDF format, it doesn't show anything nor throw any error – nothing. Btw, I am using the latest Lyx 2.0.0. Any suggestion what could have gone wrong here. Thanks.
Best Answer
I also ran into this problem and managed to fix it in the following way: The preamble:
Not sure if the load order matters, but you need to include both the
tikz
thepgf
packages or specify that you explicitly want to usetikz
in your graphs.The latter is done like this:
I'm not sure if it possible to specify this somewhere global for your whole document.
Also don't forget to enable
-shell-escape
in the call to pdflatex, this can be done inPreferences > File Handlers > Converters
by changing theLaTeX (pdflatex) -> PDF (pdflatex)
topdflatex -shell-escape $$i
.