# Drawing lines between arbitrary words on a page

I try to get rid of tree-dvips and look for a way to do the following: Circle an arbitrary word on the page and draw an arrow from some other position at the page towards this circled word. In tree-dvips one can just simply declare a word a node and then use connection directives. I guess this can be done with pgf somehow, but the nodes seem to require a position in a coordinate system.

This is the tree-dvips code:

\documentclass{scrbook}

\usepackage{tree-dvips}

\begin{document}

\begin{tabular}{lllllll}
\node{bazas}{bāz-a\v{s}} & agar & mi-xāh-i                       & fardâ    & \node{blk1}{} & bo-kon-i\\
open-\textsc{3sg}        & if   & \textsc{ipf}-want-\textsc{2sg} & tomorrow & {}                & \textsc{sbj}-do-\textsc{2sg}\\
\end{tabular}\\[2ex]
If you want to open it tomorrow \ldots'
{\makedash{1pt} \nodeoval{bazas} \abarnodeconnect[-18pt]{blk1}{bazas}}

\end{document}

-
I smell a TikZ solution... –  cgnieder Sep 12 '12 at 12:49

run it with xelatex

\documentclass{scrbook}
\usepackage{fontspec}
\usepackage{pst-node}

\begin{document}

\begin{tabular}{lllllll}
\ovalnode[linestyle=dashed]{bazas}{bāz-a\v{s}} & agar & mi-xāh-i  & fardâ
& \rnode{blk1}{~} & bo-kon-i\\
open-\textsc{3sg}        & if   & \textsc{ipf}-want-\textsc{2sg} & tomorrow & {}
& \textsc{sbj}-do-\textsc{2sg}\\
\end{tabular}\\[2ex]
If you want to open it tomorrow \ldots'
\ncbar[linestyle=dashed,arrows=->,angle=-90,arm=20pt]{blk1}{bazas}

\end{document}


-

Addition: A solution with tikz:

\documentclass{scrbook}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric}

\begin{document}

\begin{tabular}{lllllll}
\tikz[remember picture,baseline]\node[anchor=base,ellipse,draw](bazas){baz-a\v{s}};
& agar
& mi-xah-i
& fardâ
% & \node{blk1}{}
& \tikz[remember picture,overlay]
\draw[->,dashed] (0,0) -- ++(0pt,-4.75ex) coordinate(tmp1)
-- (bazas |- tmp1) -- (bazas |- tmp1) -- (bazas);
& bo-kon-i
\\
open-\textsc{3sg}
& if
& \textsc{ipf}-want-\textsc{2sg}
& tomorrow & {}
& \textsc{sbj}-do-\textsc{2sg}\\
\end{tabular}\\[2ex]
If you want to open it tomorrow \ldots'

\end{document}
`

-