I'm using the decorations library to put bended text along a path. That works fine. However, I'd like to have the bended text as a node, so that I can later use it as a reference (for instance to draw a line to it). Is that possible? How do I define the nodes's name?
Here you have a MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.text}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}
\node at (0,0) (nodeA) {A};
\node at (2,2) (nodeB) {B};
\draw (nodeA) -- (nodeB);
\draw [decoration={text along path,
text={path text},text align={center}},decorate] (nodeA) -- (nodeB);
\node at (0,2) (nodeC) {C};
\draw [->] (nodeC) -- (.8,1.2);
\end{tikzpicture}
\end{document}
In the last bit, where a line is drawn from (nodeC) to the "path text", I had to use a coordinate, but I'd like to be able to use the a node reference.
The picture looks like this:


\node [rotate=XX]. The thing is how to compute the angle of the line connecting nodeA and nodeB. Is that possible? Obviously this would only work on straight lines, not curves. But I might be happy with it. – Didac Busquets Oct 11 '12 at 09:24\draw (nodeA) -- (nodeB) node [midway, above, sloped] (TextNode) {path text};does the trick if you don't want the text along a curved path. Now you have theTextNodeto reference it, so\draw [->] (nodeC) -- (TextNode)give you an arrow pointing towards the text. – Peter Grill Oct 11 '12 at 10:35