Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I also ran into this problem and managed to fix it in the following way: The preamble:

\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage{dot2texi}

Not sure if the load order matters, but you need to include both the tikz the pgf packages or specify that you explicitly want to use tikz in your graphs.

The latter is done like this:

\begin{dot2tex}[neato,tikz,options=-tmath]

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 in Preferences > File Handlers > Converters by changing the LaTeX (pdflatex) -> PDF (pdflatex) to pdflatex -shell-escape $$i.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.