Re: tikz automata: splitting merged edges
- From: "Zarko F. Cucej" <zarko.cucej@xxxxxxxxx>
- Date: Tue, 20 Oct 2009 05:22:08 +0200
Nuno J. Silva wrote:
I'm trying to draw some state machines, using the pgf tikz "automata"
library.
In some cases, the machines will have pairs of states involved in two
events, in different directions.
An example: - When in q_0, if input is "a", go to q_1;
- When in q_1, if input is "b", go to q_0.
For this, I wrote the following code:
\begin{tikzpicture}[auto]
\node[state,initial] (q_0) {$q_0$};
\node[state] (q_1) [right=of q_0] {$q_1$};
\path[->] (q_0) edge node {a} (q_1)
(q_1) edge node {b} (q_0);
\end{tikzpicture}
But this results in a picture with only one line for the two paths,
making it impossible to understand which input does what.
Is there a way to force two distinct lines to be drawn?
is
\begin{tikzpicture}[node distance=33mm]
\node[state,initial] (q_0) {$q_0$};
\node[state] (q_1) [right of = q_0] {$q_1$};
\path[->] (q_0) edge [bend left] node[above] {a} (q_1)
(q_1) edge [bend left] node[below] {b} (q_0);
\end{tikzpicture}
what you looking for? if not, see TikZ and PGF examples in
http://www.texample.net/tikz/examples/
maybe you find there some ideas.
regards, Zarko
.
- Follow-Ups:
- Re: tikz automata: splitting merged edges
- From: Nuno J. Silva
- Re: tikz automata: splitting merged edges
- References:
- tikz automata: splitting merged edges
- From: Nuno J. Silva
- tikz automata: splitting merged edges
- Prev by Date: Re: displaying unicode x2258
- Next by Date: Re: Reg: Need Solution for Overfull Boxes Information in LOG file
- Previous by thread: tikz automata: splitting merged edges
- Next by thread: Re: tikz automata: splitting merged edges
- Index(es):
Relevant Pages
|