I'm trying to embed TiKZ code in my LyX document. When exporting the document to pdf (pdflatex) I get a blank area instead of the TiKZ output. Here's what I've done:
I've added the following two lines to LaTeX Preamble:
\usepackage{tikz}
\usetikzlibrary{automata,positioning}
I've added the following to a new TeX code:
\begin{tikzpicture}[shorten >=1pt, node distance=2cm, on grid, auto]
\node[state, initial] (q_0) {$q_0$};
\node[state] (q_1) [above right=of q_0] {$q_1$};
\node[state] (q_2) [below right=of q_0] {$q_2$};
\node[state, accepting] (q_3) [below right=of q_1] {$q_3$};
\path[->]
(q_0) edge node {0} (q_1)
edge node [swap] {1} (q_2)
(q_1) edge node {1} (q_3)
edge [loop above] node {0} ()
(q_2) edge node [swap] {0} (q_3)
edge [loop below] node {1} ();
\end{tikzpicture}
(The code is copied from another tex.stackexchange answer: Which package can be used to draw automata?)
What's wrong with what I've done?
*.lyxfile: This is the first document – TheVal Oct 20 '13 at 19:12.lyxfile (it is a plain text file, so just open it in a text editor and copy the text) or at least the exported LaTeX source code. – Torbjørn T. Nov 06 '13 at 22:13