I am a new TikZ user and I started using the package to create FSMs. It all worked fine until I came across the issue of naming edges that are bent.
There is a relevant question for text on edges here. But when I try to adapt it to my problem, namely to use it as
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\node (One) at (-3,0) [shape=circle,draw] {$One$};
\node (Two) at ( 3,0) [shape=circle,draw] {$Two$};
\def\myshift#1{\raisebox{-2.5ex}}
\draw [->,
thick,
postaction={decorate,
decoration={text along path,
text align=center,
text={|\sffamily\myshift|SUPERSCRIPT^{TEST}}
}
}
] (One) to [bend right=45] (Two);
\end{tikzpicture}
\end{document}
It will not work. The SUPERSCRIPT^{TEST} causes an error. And I have not found a way to use text that has no superscripts in that way. Is there a work-around for this?
Thank you in advance.


