0

I've been able to draw the states, and the arrows between the states. It's the "labeling" around the automata I've got issues with ( I, E, P, and R).. Any ideas?

Example

4
  • 2
    Welcome to TeX.SE! Could you please provide us with what you have achieved to do?
    – user121799
    Oct 1, 2018 at 21:46
  • 2
    Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See minimal working example (MWE). Oct 1, 2018 at 22:01
  • 2
    TikZ has a whole library for drawing automata. Are you using it? It makes lablelling connections between states simple. But without showing your code it's hard to tell what you are doing. See Which package can be used to draw automata?.
    – Alan Munn
    Oct 2, 2018 at 1:51
  • I agree with @AlanMunn. I also find it very hard to guess what your doing after my crystal ball got stolen. ;-)
    – user121799
    Oct 2, 2018 at 2:04

1 Answer 1

3
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{matrix,positioning,calc}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes,nodes in empty cells,column sep=3.14mm,row sep=3.14mm,
nodes={draw,circle,fill=cyan!50,minimum size=1cm}] (mat) {
 & & & \\
 & & & \\
};
\node[left=3.14mm of mat-1-1,font=\sffamily] {P};
\node[left=3.14mm of mat-2-1,font=\sffamily] {R};
\path ($(mat-1-1.north)!0.5!(mat-1-2.north)$) coordinate (x1)
($(mat-1-2.north)!0.5!(mat-1-3.north)$) coordinate (x2)
($(mat-1-3.north)!0.5!(mat-1-4.north)$) coordinate (x3)
($(mat-2-2.south)!0.5!(mat-2-3.south)$) coordinate (x4);
\node[above=3.14mm of x1,font=\sffamily] {I};
\node[above=3.14mm of x3,font=\sffamily] {E};
\draw[dotted] (x2) -- (x4);
\end{tikzpicture}
\end{document}

enter image description here

3
  • 61k rep and still not tired of answering do-it-for-me questions. That's some real dedication. Oct 2, 2018 at 0:25
  • 2
    @HenriMenke My willingness is inversely proportional to the reputation of the user. (You could just upvote those users to prevent me from answering these questions. ;-) A bit more seriously, there is a long discussion on whether or not one should "educate" users. I see and respect the arguments of both sides, but my take on this is that (a) I do not educate users and (b) the answer is for everyone, not just the asker.
    – user121799
    Oct 2, 2018 at 0:29
  • Thank you! I did not receive a notification that my answer had been answered.
    – Maritb
    Oct 22, 2018 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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