[Tex/LaTex] How to tell the arrow pointing to the start state to point from up

automatatikz-pgf

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.

Best Answer

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