#getting error when trying to use tikz

1 messages · Page 1 of 1 (latest)

quiet lynx
#

As above says, not entirely sure what’s going wrong, don’t understand the error message sorry, images attached

real lance
#

on line 2 you said "on grid" but it doesn't understand what that means

quiet lynx
#

Ok so this is smth my professor is trying to do, he’s just been getting into discord but knows latex and I’m not entirely sure what this is but he’s not on this server so I offered to ask, any idea what he’s trying to do with on grid and how he could fix it? Sorry for the trouble lol

real lance
#

,texdoc tikz

copper ginkgoBOT
swift leafBOT
quiet lynx
#

I see ty

hasty pollen
#
\usetikzlibrary{automata}
\lipsum[1]%dummy text
\begin{figure}[!htbp]
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid=true]%<- on grid has to be followed by = true or false
\node[state] (q_0) {$q_0$};
\node[state] (q_1) [right=of q_0] {$q_1$};
\node[state, accepting] (q_2) [right=of q_1] {$q_2$};

\path[->] (q_0) edge [loop below] node {0,2} ()
          (q_2) edge [loop above] node {0,1} ()
          (q_1) edge [loop above] node {0,2} ()
          (q_0) edge [bend right=50] node [below] {1} (q_2)
          (q_1) edge [bend left=50] node [above] {1} (q_2)
          (q_2) edge node [below] {2} (q_1);
\end{tikzpicture}
\caption{An automaton with cycle language at $q_2$ having $F(22)=9$.}
\label{fig:Fexam}
\end{figure}
real lance
#

do a ctrl+f for "on grid"

swift leafBOT
#

Purr ❄

ocean ocean
#

automata library go hard

quiet lynx
#

Tysm

hasty pollen
#

For future reference, you should copy and paste the codes instead of just sending pictures.

quiet lynx
#

Thanks so much got it

hasty pollen
#

You’re welcome thumb

quiet lynx
#

How do I mark as closed sorry

hasty pollen
#

I think it’s like .resolved or something

quiet lynx
#

.resolved