5

I am drawing finite automata in Tex using the tikz automata library. Here is how my figure begins.

\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] 
\node[state,initial] (q_start)   {$q_start$};

This creates an initial node. The "start ->" arrow is pointing to the node from the left.

How do I change this direction? I want "start ->" to point at the initial node from the top.

1 Answer 1

8

Key initial where sets the direction (above, below, left, right), see 24.3 Initial and Accepting States of the manual.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata,positioning}
\usepackage{amstext}
\begin{document}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]
\node[state,initial,initial where=above,] (q_start)   {$q_\text{start}$};
\end{tikzpicture}
\end{document}   

Result

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .