Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 5 down vote accepted

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

An example

\documentclass{standalone}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usepackage[latin1]{inputenc}
\begin{document}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.8cm,
                    semithick]
  \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);
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

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.