Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm attempting to find a way of linking two objects in avm.sty together. The result I want is exactly that specified here: http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/avms/#4

I'm using pdftex so tree-dvips does not work. How can the same effect be achieved in pdftex? I assume it could be done with tikz, but I cannot for the life of me work out how.

Sample code is here:

\begin{avm}
\[{} PRED `avoid <SUBJ, OBJ>'; TNS $\neq$ PAST \\
     TOPIC \[ PRED `kind<COMP>' \\
                    DEF +; LOC FAR; NUM SG \\
                    COMP \[ PRED `of <OBJ>' \\
                            OBJ \[ PRED `cake'\] \] \] \\
     SUBJ \[ PRED `pro'; NUM SG; PERS 1; CASE NOM\] \\
     OBJ \[ $\qquad$ \] \\
     ADJ \[ PRED `usually'\] \]
\end{avm}

A tree-dvips implementation would be as follows:

\begin{avm}
\[{} PRED `avoid <SUBJ, OBJ>'; TNS $\neq$ PAST \\
     \node{topic}{TOPIC \[ PRED `kind<COMP>' \\
                    DEF +; LOC FAR; NUM SG \\
                    COMP \[ PRED `of <OBJ>' \\
                            OBJ \[ PRED `cake'\] \] \]} \\
     SUBJ \[ PRED `pro'; NUM SG; PERS 1; CASE NOM\] \\
     \node{object}{OBJ \[ $\qquad$ \]} \\
     ADJ \[ PRED `usually'\] \]
\end{avm}
\nodecurve[r]{topic}[r]{object}{2in}

The best I've been able to come up with using tikz is:

\begin{avm}
\[{} PRED `avoid <SUBJ, OBJ>'; TNS $\neq$ PAST \\
     \tikz \node (topic) {TOPIC \[ PRED `kind<COMP>' \\
                    DEF +; LOC FAR; NUM SG \\
                    COMP \[ PRED `of <OBJ>' \\
                            OBJ \[ PRED `cake'\] \] \]}; \\
     SUBJ \[ PRED `pro'; NUM SG; PERS 1; CASE NOM\] \\
     \tikz \node (object) {OBJ \[ $\qquad$ \]}; \\
     ADJ \[ PRED `usually'\] \] \tikz \node (viapoint) {};
\end{avm}

\tikz[overlay] \draw[-] (topic) to[out=0,in=90  ] (viapoint)
                        (viapoint) to[out=270,in=0] (object);

However this results in two disconnected lines, one of which goes through other text.

Any help on improvement would be greatly appreciated.

share|improve this question
2  
It would be a lot easier to help you if you posted complete compilable documents rather than fragments. –  Alan Munn Jun 21 '13 at 2:20

1 Answer 1

up vote 3 down vote accepted

Here's a solution using the tikzmark library. (Documented separately: texdoc tikzmark will show its documentation.)

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{avm}
\usepackage{tikz}
\usetikzlibrary{tikzmark,positioning}
\begin{document}
\begin{avm}
\[{} PRED `avoid <SUBJ, OBJ>'; TNS $\neq$ PAST \\
      TOPIC \[ PRED `kind<COMP>' \\
                    DEF +; LOC FAR; NUM SG \\
                    COMP \[ PRED `of <OBJ>' \\
                            OBJ \[ PRED `cake'\] \] \]\tikzmark{topic} \\
     SUBJ \[ PRED `pro'; NUM SG; PERS 1; CASE NOM\] \\
      OBJ \[ $\qquad$ \]\tikzmark{object} \\
     ADJ \[ PRED `usually'\] \]
\end{avm}

\tikz[remember picture,overlay] 
    \draw[-] (pic cs:topic) to[out=0,in=0,looseness=2]  (pic cs:object);

\end{document}

output of code

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.