[OS X TeX] problems with TikZ examples
Alain Matthes
alain.matthes at mac.com
Tue Dec 30 11:18:38 EST 2008
Le 30 déc. 08 à 15:04, Art Werschulz a écrit :
> Hi.
>
> I am exploring TikZ/PGF, and having some trouble getting some of the
> examples in the manual to work.
> (BTW, a 560-page manual is a bit daunting.)
>
> I first tried the example developed in Section 2 (Tutorial: A
> Picture for Karl's Students). The TeX file is as follows:
>
> \documentclass{article}
> \usepackage{tikz}
>
> \begin{document}
> ... copy-and-paste of source on page 36 ...
> \end{document}
>
> When I ran pdflatex on same, I got the following msg:
> ! Package pgfkeys Error: I do not know the key '/tikz/axes'
> and I am going to ignore it. Perhaps you misspelled it.
> I typed "q" in response to same. Despite the warning, the resulting
> PDF file displayed correctly.
>
> I then tried one of the automata in Section 23 (Automata Drawing
> Library). The TeX file is as follows:
>
> \documentclass{article}
> \usepackage{tikz}
> \usetikzlibrary{automata}
>
> \begin{document}
> ... copy-and-paste of source on bottom of page 23 ...
> \end{document}
Hi
You need the positioning library for this example
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata,%
positioning}
\begin{document}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]
\draw[help lines] (0,0) grid (3,2);
\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}
\end{document}
For the first example, Peter is right, a comma is missing
\begin{tikzpicture}
[scale=3,line cap=round, %<------ here
Best Regards
Alain
More information about the MacOSX-TeX
mailing list