When using the initial state with the automata drawing library for the tikzpicture environment, I have been unable to find a way to change the color of the initial state on a per-node basis.
That is, I want to be able to have different colors for initial states in the same instance of a tikzpicture environment.
I would also be fine with the creation of a style or workaround that doesn't directly use the initial state but functionally and visually looks the same.
For example, in the LaTeX below, I am able to do this on a tikzpicture environment basis, but I would like to be able to modify it on a per-node basis:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, automata}
% The pgfkey for creating graphs used in tikzpicture
\tikzset{
discrete graph/.style={
->,
>=stealth',
auto,
thick,
main node/.style={circle, draw, font={\sffamily\bfseries\Large#1}},
nolooparrow/.style={-, every loop/.append style={-}},
double arrows/.style args={##1, ##2, ##3}{
decorate,
decoration={
markings,
mark=at position 0 with {
\coordinate (ta-base-1) at (0, ##3pt);
\coordinate (ta-base-2) at (0, -##3pt);
},
mark=at position 1 with {
\draw[##1] (ta-base-1) -- (0,##3pt); \draw[##2] (ta-base-2) -- (0,-##3pt);
}
}
},
every node/.style={font=\sffamily\small},
},
}
\begin{document}
\begin{tikzpicture}[discrete graph=\normalsize, node distance=2.5cm]
\node[main node, state, initial] (a) {$q_0$};
\end{tikzpicture}
\begin{tikzpicture}[discrete graph=\normalsize, node distance=2.5cm, every initial by arrow/.style={red}]
\node[main node, state, initial, red] (a) {$q_0$};
\end{tikzpicture}
\end{document}