I want to use the TikZ automata library to draw finite automata where the size of the state nodes remains the same regardless of whether the state is accepting or not.
Here's a MWE demonstrating the issue.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata}
\tikzstyle{accepting}=[double distance=2pt, outer sep=1pt+\pgflinewidth]
\begin{document}
\begin{tikzpicture}
\draw[help lines, step=.5cm] (0, 0) grid (4,2);
\node[state] (q0) at (1,1) {};
\node[state, accepting] (q1) at (3,1) {};
\draw (q0) edge [bend left=15, ->] (q1);
\end{tikzpicture}
\end{document}
You can see that the accepting node is larger than the nonaccepting node.
I believe I understand why this is happening: double distance
turns on double
which causes TikZ to draw two circles with different colors and different widths, first in black with width 2pt+2\pgflinewidth
and then in white with width 2pt
. This results in the appearance of a double line.
Is there a way that I can modify the style set by accepting
such that it reduces the size of the node (or maybe inner sep
) appropriately such that the node size doesn't change? Alternatively, can I cause accepting
to simply draw a second circle centered on the node?