[Tex/LaTex] How to change the position of the initial text in TikZ automata

automatapositioningtikz-pgf

It seems PGF manual for v1.18 doesn't cover the case on how to change the position of the initial text relative to the initial transition. Accoring to the PGF manual section 19.3 the parameters of initial state allow me to change the position of the text:

– initial where=⟨direction⟩ set the place where the text should be shown. Allowed values are above, below, left, and right.

This, however, changes the position of both arrow and the text, for instance

\begin{tikzpicture}[>=latex, initial text={start}, initial where=left]
\node[state,initial] (q_0);
\end{tikzpicture}

results in this:

current

What I'd like to have is the text positioned relative to the arrow, e.g. above:

goal

Is there a standard way to achieve this?

Best Answer

I have not seen that this feature is supported by the library automata. But the arrow with text can be disabled and the drawing can be done with usual TikZ means:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata}

\begin{document}

\begin{tikzpicture}[>=latex]
  \node[state] (q_0) {$q_0$};
  \draw[<-] (q_0) -- node[above] {start} ++(-2cm,0);
\end{tikzpicture}

\end{document}

Result

Related Question