6

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.

  • 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
4

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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