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 try to draw rhe following three figures. The left is just a sequence of symbols NP V NP AP, the middle one is a unary branching tree and the right one is a binary brancing tree. I want to place a V below the respective items and connect the V with an arrow to the V in the leftmost figure to the lower V in the middle figure and to the lower right V in the right figure. I guess there is a straightforward way (or several ways) to do this.

\documentclass{scrbook} 

\usepackage{tikz-qtree}
\tikzset{every roof node/.append style={inner sep=0.1pt,text height=2ex,text depth=0.3ex}}

\newcommand{\sliste}[1]{%
\mbox{%
$\left\langle\mbox{\scshape #1}\right\rangle$}%
}

\newcommand{\trace}{\raisebox{0.2ex}{\_}\rule{0cm}{0.7em}}



\begin{document}

\begin{figure}[htbp]
\hfill
\begin{tikzpicture}[baseline=(construction.base)]
\draw (0,0) node {V} -- (0,1) node (construction) {NP V NP AP};
\end{tikzpicture}
\hfill
\begin{tikzpicture}[baseline=(V.base)]
\Tree[.\node (V) {V \sliste{ NP, NP, AP }}; \node (v-in) {V \sliste{ NP }}; ]
\node (v-lex) {V};
\draw (v-lex) (v-in);
\end{tikzpicture}
\hfill
\begin{tikzpicture}[baseline=(V.base)]
\Tree[.\node (V) {V \sliste{ NP, NP, AP }};
        [.{V \sliste{ NP, NP, AP, [1] }} \trace{} ]
        \node (v-in) {[1] V \sliste{ NP }}; ]
\node (v-lex) {V};
\draw (v-lex) (v-in);
\end{tikzpicture}


\hfill\mbox{}
\caption{\label{phrasal-lexical-empty}Phrasal analysis, lexical analysis and analysis with an empty head}
\end{figure}

\end{document}
share|improve this question
    
Just to clarify your objective. You want a V below each figure (so a total of 3 V's) and connected them via an arrow line. –  Jesse Mar 1 at 12:29
    
Yes, correct! (did you know that comments must be at least 15 characters in length?) Some people need a lot of words to say yes. –  Stefan Müller Mar 1 at 12:33
    
Ya, someone commented on this weird situation you are facing now. –  Jesse Mar 1 at 12:38

1 Answer 1

New Update:

If 3 independent tikzpicture environment are preferred, the following code achieves that.

\documentclass{article} 
\usepackage[margin=1cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows}
\usepackage{tikz-qtree}
\tikzset{every roof node/.append style={inner sep=0.1pt,text height=2ex,text depth=0.3ex}}

\newcommand{\sliste}[1]{%
\mbox{%
$\left\langle\mbox{\scshape #1}\right\rangle$}%
}

\newcommand{\trace}{\raisebox{0.2ex}{\_}\rule{0cm}{0.7em}}
\thispagestyle{empty}
\begin{document}

\tikzset{line/.style={<->,>=stealth}}  % new style for conneting lines
\begin{figure}[!htbp]
\centering

\raisebox{1.5cm}{
\begin{tikzpicture}%[yshift=5cm]
\Tree[.\node (construction) {\phantom{$\langle$}NP V NP AP\phantom{$\rangle$}}; ]
\node[below =0.5cm of construction,xshift=-2ex] (left) {V};
\draw[line] (left.north)  to ([xshift=-2ex]construction.south);
\end{tikzpicture}
}
\begin{tikzpicture}%[xshift=3cm]
\Tree[.\node (V)    {V \sliste{ NP, NP, AP }}; 
          \node (v-in) {V \sliste{ NP }}; ]
\node[below = 2cm of V] (middle) {V};
\draw [line] (middle.north) to ([xshift=-3ex]v-in.south);
\end{tikzpicture}
\begin{tikzpicture}%[xshift=8cm]
\Tree[.\node (V) {V \sliste{ NP, NP, AP }};
        [.{V \sliste{ NP, NP, AP, [1] }} ]
        \node (v-in) {[1] V \sliste{ NP }}; ]
\node [below=2cm of V](right) {V};
\draw [line]  (right.north) to ([xshift=-3ex]v-in.south);
\end{tikzpicture}
\caption{\label{phrasal-lexical-empty}Phrasal analysis, lexical analysis and analysis with an empty head}
\end{figure}

\end{document}

According to the OP's comments below, the connection is different from the first suggestion. Since very designated V has its internal label left, middle, right, this update uses them via the following command to connect their upper level v's

\draw [name1.north] to ([yshift=-<dim>]name2.south);

enter image description here

Code

\documentclass{article} 
%\usepackage[papersize={20cm,6cm}]{geometry}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows}
\usepackage{tikz-qtree}
\tikzset{every roof node/.append style={inner sep=0.1pt,text height=2ex,text depth=0.3ex}}

\newcommand{\sliste}[1]{%
\mbox{%
$\left\langle\mbox{\scshape #1}\right\rangle$}%
}

\newcommand{\trace}{\raisebox{0.2ex}{\_}\rule{0cm}{0.7em}}
\thispagestyle{empty}
\begin{document}

\tikzset{line/.style={<->,>=stealth}}  % or >=latex' :new style for connecting lines
\begin{figure}[htbp]
\begin{center}
\begin{tikzpicture}
\begin{scope}
\Tree[.\node (construction) {\phantom{$\langle$}NP V NP AP\phantom{$\rangle$}}; ]
\node[below =2cm of construction] (left) {V};
\draw[line] (left.north)  to ([xshift=-2ex]construction.south);
\end{scope}

\begin{scope}[xshift=3cm]
\Tree[.\node (V)    {V \sliste{ NP, NP, AP }}; 
          \node (v-in) {V \sliste{ NP }}; ]
\node[below = 2cm of V] (middle) {V};
\draw [line] (middle.north) to ([xshift=-3ex]v-in.south);
\end{scope}

\begin{scope}[xshift=8cm]
\Tree[.\node (V) {V \sliste{ NP, NP, AP }};
        [.{V \sliste{ NP, NP, AP, [1] }} ]
        \node (v-in) {[1] V \sliste{ NP }}; ]
\node [below=2cm of V](right) {V};
\draw [line]  (right.north) to ([xshift=-3ex]v-in.south);
\end{scope}
\end{tikzpicture}
\hfill\mbox{}
\caption{\label{phrasal-lexical-empty}Phrasal analysis, lexical analysis and analysis with an empty head}
\end{center}
\end{figure}

\end{document}

This is an attempt where scope environment is used to place the three figures with xshift=xx<dim> in the scope options. Furthermore, the location of V below each figure is determined via positioning library from tikz.
enter image description here

   Code

        \documentclass{article} 
        \usepackage{tikz}
        \usetikzlibrary{positioning}
        \usepackage{tikz-qtree}
        \tikzset{every roof node/.append style={inner sep=0.1pt,text height=2ex,text depth=0.3ex}}

        \newcommand{\sliste}[1]{%
        \mbox{%
        $\left\langle\mbox{\scshape #1}\right\rangle$}%
        }

        \newcommand{\trace}{\raisebox{0.2ex}{\_}\rule{0cm}{0.7em}}
        \thispagestyle{empty}
        \begin{document}


        \begin{figure}[htbp]
        \begin{center}
        \begin{tikzpicture}
        \begin{scope}
        \Tree[.\node (construction) {\phantom{$\langle$}NP V NP AP\phantom{$\rangle$}}; ]
        \node[below =2cm of construction] (left) {V};
        \end{scope}

        \begin{scope}[xshift=3cm]
        \Tree[.\node (V)    {V \sliste{ NP, NP, AP }}; 
                  \node (v-in) {V \sliste{ NP }}; ]
        \node[below = 2cm of V] (middle) {V};
        \draw [<->] (left) to (middle);
        \end{scope}

        \begin{scope}[xshift=8cm]
        \Tree[.\node (V) {V \sliste{ NP, NP, AP }};
                [.{V \sliste{ NP, NP, AP, [1] }} ]
                \node (v-in) {[1] V \sliste{ NP }}; ]
        \node [below=2cm of V](right) {V};
        \draw [<->]  (middle) to (right);
        \end{scope}
        \end{tikzpicture}
        \hfill\mbox{}
        \caption{\label{phrasal-lexical-empty}Phrasal analysis, lexical analysis and analysis with an empty head}
        \end{center}
        \end{figure}

        \end{document}
share|improve this answer
    
Thanks! But the Vs in the bottom line should not be connected to each other but to special Vs in the representations above them. The leftmost to the only verb that is there, the middle one to the lowest verb and the right-most V to the right V in the tree. But the \node[below ] and the xshift hint was already very helpful! –  Stefan Müller Mar 1 at 17:00
    
Ha, that is why I ask before posting mine. Well, every v has an internal label called left, middle and right. You can use \draw [<->](name1) to (name2) to draw a line with arrow –  Jesse Mar 1 at 17:10
    
@StefanMüller -- Would these changes within each scope (1) \draw[<->] (left) to (construction); (2) \draw [<->] (middle) -- (v-in); (3) \draw [<->] (right) to (v-in); be what you need? –  Jesse Mar 1 at 17:24
    
Thanks! Is there a way to get the left-most V right below the V it points to? The middle and right ones are OK. I will connect to the complete node (v-in) without shifting. The scope and shift solution seems to be problematic if the font size changes because of the absolute positioning. I would stick to the three separate tikzpictures. In fact these are three pictures logically. They are compared in this figure. Does it make sense to have separate tikzpictures? –  Stefan Müller Mar 2 at 9:23
    
Yes, replace the second line in the first scope with \node[below =0.5cm of construction,xshift=-2ex] (left) {V};. This will put the v at the place you wish. As to the independent tikzpicture like the orignal OP showed, the last one may shift down, and therefore can not be aligned in one line for those 3 tikzpictures. You could put the fontsize into the tikzpicture [options] so that the desired fontsize can apply all 3 scopes. –  Jesse Mar 2 at 9:49

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.