TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am drawing finite automata with TikZ. Currently, transition arrows overlap between nodes because they both go across horizontally. How can I tell one arrow to arc above and the other arrow to arc under?

Here's what I have:

(q_0) edge node {H} (q_1)
(q_1) edge node {T} (q_0)
share|improve this question
up vote 8 down vote accepted

You can use bend left or bend right in the options for edge as per the need.

An example

\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.8cm,
  \tikzstyle{every state}=[fill=magenta!40,draw=none,text=white]

  \node[initial,state] (A)                    {$q_a$};
  \node[state]         (B) [above right of=A] {$q_b$};
  \node[state]         (C) [below right of=B] {$q_c$};

  \path (A) edge              node {0,1,L} (B)
            edge [bend left]  node {1,1,R} (C)
        (B) edge [loop above] node {1,1,L} (B)
            edge              node {0,1,L} (C)
        (C) edge [bend left] node {0,1,L}  (A);


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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