I want to draw a line from one part of the text (on the page) to another part. I'm storing (relative) coordinates, and this is the reason why my MWE doesn't work. Is there any way, using TikZ, of doing so? (Note that I wish to keep apart the TikZ pictures, i.e., I do not want to include the whole text in one TikZ picture environment.)
I have the following MWE:
\documentclass{article}
\usepackage{tikz}
\begin{document}
This is my text.\tikz\coordinate (one) at (0,0);
\bigskip\ldots\bigskip\bigskip
This is another text.\tikz{\coordinate (two) at (2,2); draw [red, thick, fill](one) --> (two);}
\end{document}
And this is, of course, what I get:
Update 1
According to the TikZ-PGF manual (p.249) I must use the remember picture and overlay options. This is the new code:
\documentclass{article}
\usepackage{tikz}
\begin{document}
This is my text.\tikz[remember picture] \node[circle,fill=red!50] (n1) {};
\bigskip\ldots\bigskip\bigskip
This is another text.\tikz[remember picture] \node[fill=blue!50] (n2) {};
\begin{tikzpicture} [remember picture, overlay]
draw [red, very thick](n2) --> (n1);
\end{tikzpicture}
\end{document}
But it doesn't work either:



draw– vaettchen Sep 28 '15 at 19:44