# Interrupting edges for node text when the background is non-white

In interrupting edge in automata, a simple way to interrupt an edge is given. It is simple and helpful, iff the background happens to be white (or at least a determined single color). Is there a way to achieve this effect when the background is a gradient/indeterminate?

• If you 'draw' the path first with draw=none or just \path to place the node, you can then draw to and from the node. However, you might not get as smooth a curve as you'll have two curves in that case. – cfr Oct 9 at 15:04

This is a task for the reverse clip trick, see e.g. here for a very similar application.

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

\begin{document}

\begin{figure}[htb]
\centering
\begin{tikzpicture}[->,>=stealth', node distance=3.6cm]
(-1,-1) rectangle (4,4);
\node[state] (1) {1};
\node[state] (0) [above right of=1] {2};

\path (0) to[bend left]   node[midway](C) {01} (1);
\clip (C.north east) rectangle (C.south west)
(current bounding box.south west) -| (current bounding box.north east)
-| cycle;
\draw (0)  to[bend left] (1);

\end{tikzpicture}
\end{figure}
\end{document}


You can also make this a style for the node, see this post. (Note, though, that the use path key there differs from the one recently added to TikZ.)Please see here for an experimental library that contains style for this and similar styles.