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.

When there are two nodes pointing to the same node, the picture looks odd because they point to the same location. How can I change the location of pointing?

For instance,

\documentclass[10pt,letterpaper]{article}
\usepackage[latin1]{inputenc}
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry} 
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\def\xcolorversion{2.00}
\def\xkeyvalversion{1.8}

\usepackage[version=0.96]{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,petri,positioning}

\begin{document}    
    \textbf{DFA}\\
    \begin{tikzpicture}[shorten >=1pt,node distance=3cm,on grid,auto] 
        \node[state,initial,accepting]      (q_0)                           {$q_0$};
        \node[state,accepting]              (q_1)   [right=of q_0]          {$q_1$};
        \node[state]                        (q_2)   [right=of q_1]          {$q_2$};    
        \node[state,accepting]              (q_3)   [right=of q_2]          {$q_3$}; 
        \node[state]                        (q_4)   [above right=of q_3]    {$q_4$};    
        \node[state,accepting]              (q_5)   [below right=of q_3]    {$q_5$};        

        \path[->]
        (q_0)   edge    [bend right]        node {0}            (q_1)
        (q_0)   edge    [bend right]        node {1}            (q_3)

        (q_1)   edge    [above,bend right]  node {0}            (q_0)
        (q_1)   edge    [above,bend right]  node {0}            (q_3)

        (q_2)   edge                        node {0}            (q_1)
        (q_2)   edge    [above,bend left]   node {0}            (q_4)

        (q_3)   edge                        node {0,1}          (q_5)

        (q_4)   edge                        node {0,1}          (q_3)
        (q_5)   edge    [loop below]        node {0,1}          (q_1)

        ; %end path 
    \end{tikzpicture}
\end{document}  

Output of code

What I want to achieve is one arrow to point to below the circle and the other point to somewhere else.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You can fix output and input angle with in and out options

(q_0) edge [bend right, out=-60, in=240] node {1} (q_3)
share|improve this answer
1  
Thanks a lot ;). I felt in love with LaTex now. –  Chan Jun 17 '11 at 10:46
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.