I need to decorate a path with some text that includes math symbols. I followed this example, which works fine as long as I only include text. Here is the MWE (minor changes compared to example to replace \def\myshift by raise=):
\documentclass{standalone}
\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$};
\draw [->,thick,postaction={decorate,decoration={text along path,text align=center,raise=2pt,text={$b$}}}] (One) to [bend right=45] (Two);
\draw [->,thick,postaction={decorate,decoration={text along path,text align=center,raise=-7pt,text={$a$}}}] (One) to [bend left=45] (Two);
\end{tikzpicture}
\end{document}
However, as soon as I replace a by \alpha (as an example), the MWE does not compile anymore. It seems to hang and when I interrupt it with ctrl-C, I get:
! Interruption.
<to be read again>
\let
l.12 ...\alpha$}}}] (One) to [bend left=45] (Two);
(I'm running pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019).)




Package: pgf 2019/12/21 v3.1.5a (3.1.5a)). Maybe my post is confusing - since the MWE I posted is the code that works, but it breaks if I changeato\alpha? – user1362373 Dec 31 '19 at 17:13