[Tex/LaTex] How to set a default parameter for all edges

automatatikz-pgftikz-styles

Question

How do you set all edges in an automaton to have the additional parameter double?

This should be easy, but I can't find the solution here or in the tikz/pgf manual or anywhere else.

double should not be overwritten by independent parameters: edge[bend left] with default double should thus be equivalent to edge[bend left, double].

Details

Currently, I'm using the parameter everywhere:

     \path[->] 
     (s0)+(-.5cm,.5cm) edge[bend right,double] (s0)
     (s0) edge[bend left,double] node[pos=0.3] {$a$} (s1)
     (s1) edge[bend left,double] node {$\epsilon,a$} (s0)
     (s0) edge[loop above,double] node {$\epsilon,a$} (s0)
     (s1) edge[loop below,double] node {$\epsilon,a$} (s1);

I tried \path[->,double] and various combinations of \pgfset and \tikzstyle, but I just don't know how to get to set double the edge's default parameter.

Best Answer

You can add different style keys by appending or prefixing. In this context we need to append the double key to each edge. Since this appending is local to the path it doesn't affect succesive edges.

\begin{tikzpicture}
\path[->,every edge/.append style={double}] (0,0) edge[bend left] (1,1) (1,3)edge[loop above] ();
\path[->] (0,3) edge[bend left] (1,2) edge[loop above] ();
\end{tikzpicture}

Note that loop only needs () you don't need to fill the brackets.

enter image description here

Related Question