3

Questions

  1. How can I fit a tree in the blank space under where I have marked Tree 2 in the photo (directly underneath Tree 1, but to the right of \Rightarrow)?
  2. How can I caption Tree 1 and Tree 2 (labeling them respectively as "Surface Scope" and "Inverse Scope")?
  3. How can I make the \Rightarrow (much) bigger?
  4. How can I include the red lines I have drawn from "Everyone" and "Someone" to the \forall and \exists in Tree 1?
  5. How can I include the big blue circles I have put around parts of Tree 1 with their labels ("NP" and "VP")?
  6. How can I connect "Everyone" and "Someone" with another line to the \forall and \exists nodes of the newly created Tree 2?

Image for Syntactic Tree and Semantic Tree 1 (Surface Scope)

enter image description here

Code for Syntactic Tree and Semantic Tree 1 (Surface Scope)

\documentclass[12pt,a4paper]{article}   
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usepackage{ulem}
\usepackage{calc}
\newsavebox\CBox
\newcommand\hcancel[2][0.5pt]{%
    \ifmmode\sbox\CBox{$#2$}\else\sbox\CBox{#2}\fi%
    \makebox[0pt][l]{\usebox\CBox}%  
    \rule[0.5\ht\CBox-#1/2]{\wd\CBox}{#1}}

\begin{document}

\rotatebox{90}{
\begin{tikzpicture}[baseline=(current bounding box.center)]
\Tree
[.TP
   [.DP [.Everyone ] ]
   [.T\1
       [.T ]
       [.AspP
           [.Asp ]
           [.\emph{v}P
               [.\emph{v} ]
               [.VP
                   [.V hugs ]
                   [.DP [. someone ]
                        ]
                       ] 
                   ]
               ]
           ]
       ]
   ]    
]
\end{tikzpicture}
$\Rightarrow$ 
\begin{tikzpicture}[baseline=(current bounding box.center), scale=.8]
\Tree
[.{$<$t$_{1}$,\hspace{0.1cm} \\$\lbrack$ $\emptyset$ $\rbrack$, \\$\lbrack$ $\emptyset$ $\rbrack$  $>$}
    [.{$<$(e$_{2}$ $\rightarrow$ t$_{1}$) $\rightarrow$ t$_{1}$),\hspace{0.1cm} \\$\lbrack$ e$_{3}$ $\rbrack$ $>$}
        \node(wh){$\forall$} ;  ]
    [.{$<$(e$_{2}$ $\rightarrow$ t$_{1}$),\hspace{0.1cm} \\$\lbrack$ \hcancel{e$_{3}$}  $\thinspace$ $\rbrack$, \\$\lbrack$ $\emptyset$ $\rbrack$  $>$}
        [. \node (ne) {e$_{2}$}; ]
        [.{$<$t$_{1}$,\hspace{0.1cm} \\$\lbrack$ e$_{2}$  $\rbrack$, $\lbrack$ $\emptyset$  $\rbrack$ $>$}
            [.{$<$(e$_{3}$ $\rightarrow$ t$_{1}$) $\rightarrow$ t$_{1}$),\hspace{0.1cm} \\$\lbrack$ e$_{2}$ $\rbrack$, \\$\lbrack$ $\emptyset$ $\rbrack$  $>$}
                \node(wh){$\exists$} ; ]
            [.{$<$(e$_{3}$  $\rightarrow$ t$_{1}$), \hspace{0.1cm} \\$\lbrack$ e$_{2}$ $\rbrack$, \hspace{0.1cm} \\$\lbrack$ \hcancel{e$_{3}$}  $\thinspace$ $\rbrack$ $>$ }
                [. \node (ue) {e$_{3}$}; ]
                [.{$<$t$_{1}$, \hspace{0.1cm} \\$\lbrack$ e$_{2}$ $\rbrack$, \hspace{0.1cm} \\$\lbrack$ e$_{3}$ $\rbrack$ $>$ }
                    [. \node [circle,draw] (me)  {e$_{2}$ } ; ]
                    [.{$<$(e$_{2}$  $\rightarrow$ t$_{1}$), \hspace{0.1cm} \\$\lbrack$ e$_{3}$ $\rbrack$ $>$}
                        [.{$<$(e$_{3}$ $\rightarrow$ e$_{2}$  $\rightarrow$ t$_{1}$),\hspace{0.1cm} \\$\lbrack$ $\emptyset$ $\rbrack$ $>$} ]
                        [. \node [circle,draw] (le) {e$_{3}$}; ]
                    ]
                ]
            ]
        ]
    ]
]
\draw[semithick, dashed, ->] 
  (le)..controls +(south west:5) and +(south:5) .. (ue);
\draw[semithick, dashed, ->]
  (me)..controls +(south west:3) and +(south:3) .. (ne);
\end{tikzpicture}
}

\end{document}

Image for Semantic Tree 2 (Inverse Scope)

enter image description here

Code for Semantic Tree 2 (Inverse Scope)

\documentclass[12pt,a4paper]{article}   
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usepackage{ulem}
\usepackage{calc}
\newsavebox\CBox
\newcommand\hcancel[2][0.5pt]{%
    \ifmmode\sbox\CBox{$#2$}\else\sbox\CBox{#2}\fi%
    \makebox[0pt][l]{\usebox\CBox}%  
    \rule[0.5\ht\CBox-#1/2]{\wd\CBox}{#1}}

\begin{document}

\begin{tikzpicture}[baseline=(current bounding box.center), scale=.8] 
\Tree
    [.{$<$t$_{1}$,\hspace{0.1cm} \\$\lbrack$ $\emptyset$ $\rbrack$ $>$}
        [.{$<$(e$_{3}$ $\rightarrow$ t$_{1}$) $\rightarrow$ t$_{1}$),\hspace{0.1cm} \\$\lbrack$ $\emptyset$ $\rbrack$ $>$}
            \node(wh){$\exists$} ; ]
        [.{$<$(e$_{3}$  $\rightarrow$ t$_{1}$), \hspace{0.1cm} \\$\lbrack$ \hcancel{e$_{3}$} $\thinspace$ $\rbrack$ $>$ }
            [. \node (ue) {e$_{3}$};  ]
            [.\node[draw]{{$<$t$_{1}$, \hspace{0.1cm} \\$\lbrack$ e$_{3}$ $\rbrack$ $>$ }}; 
                [.{$<$(e$_{2}$  $\rightarrow$ t$_{1}$)$\rightarrow$ t$_{1}$), \hspace{0.1cm} \\$\lbrack$ e$_{3}$ $\rbrack$ $>$}
                    \node(wh){$\forall$}; ]
                [.{$<$(e$_{2}$  $\rightarrow$ t$_{1}$), \hspace{0.1cm} \\$\lbrack$ e$_{3}$ $\rbrack$ $>$}
                    [.{$<$(e$_{3}$ $\rightarrow$ e$_{2}$ $\rightarrow$ t$_{1}$),\hspace{0.1cm} \\$\lbrack$ e$_{3}$  $\rbrack$ $>$} ]
                    [. \node [circle,draw] (le) {e$_{3}$} ; ]
                ]
            ]
        ]
    ]
\draw[semithick, dashed, ->] 
    (le)..controls +(south west:5) and +(south:5) .. (ue);
\end{tikzpicture}

\end{document}
  • What do you mean by "under"? Please minimize your code as much as possible. Put everything in one listing or explain the difference between your two codes. Maybe you show us some little drawing of what you want. Do you need the arrow? Do you need a caption? Why landscape? ... – LaRiFaRi Jun 19 '15 at 9:36
  • There you go. I need it to be landscape to fit on the page. I need the logical implication arrow to go from the one tree with words on its leaves to two trees (Tree 1 and Tree 2), directly below each other. – user65526 Jun 19 '15 at 9:44
  • Do you have code for 'Tree 1'? Are 'Tree 1' and 'Tree 2' different trees? In the picture, they look like just one. – cfr Jun 19 '15 at 12:12
  • The picture includes 3 trees? You've given code for 2? I'm not clear what you are trying to describe, I don't think. I don't understand what exactly is meant to go where. – cfr Jun 19 '15 at 12:17
  • I have revised the question, hopefully making it clearer. – user65526 Jun 19 '15 at 12:39
5

Output

enter image description here

Answers

See the comments in the code for further explanation, but here's a summary of how I addressed your questions:

  1. I used \begin{scope} and \end{scope} around the code for the semantic trees so that they can be scaled and shifted independently. The surface scope tree has [xshift=9cm,scale=.8], so it's shifted right by 9 cm and shrunk by 20%. The inverse scope tree has [xshift=9cm,yshift=-8cm,scale=.8], so it's shifted right by 9 cm, down by 8 cm, and shrunk by 20%.
  2. I used \node at (5,1.5) {\textbf{Surface Scope}}; for the caption for the first semantic tree. The positioning of this node is relative to the tikz coordinate system within the scope environment. A similar node is used for the inverse scope tree.
  3. The \Rightarrow is placed within its own scope environment so it can be shifted relative to the whole tikzpicture, and I put \Huge in the node text to increase the arrow's size.
  4. Because the three trees are all within the same tikzpicture, you can connect them with lines that refer to named nodes in the different trees. For example, I named the node that contains the universal quantifier in the surface scope tree (universal-surface), and then \draw[thick, color=red] (everyone)..controls +(0,-9) and +(0,-8)..(universal-surface); connects that with the (everyone) node in the syntactic tree.
  5. By using the fit library, you can place shapes around a set of nodes that you specify. For example, \node [draw=blue, ellipse, thick, inner sep=-4pt, fit = (root-surface) (NPleft-surface) (NPright-surface)] {}; puts a blue ellipse around the nodes I named (root-surface), (NPleft-surface), and (NPright-surface). The blue labels were added using nodes positioned relative to named nodes in the tree.
  6. Drawing lines between the syntactic tree and the inverse scope tree works exactly the same as drawing lines between the syntactic tree and the surface scope tree.

Code

I cleaned up the code for your trees considerably by defining commands for your ordered sets, types, bracketed elements, etc. This way you can just tweak the formatting of the command definition and it will apply throughout the tree.

\documentclass[12pt,a4paper]{article}   
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usetikzlibrary{fit,shapes} % tikz libraries that are necessary to make the blue ellipses
\usepackage{amsmath} % for the \text{} command that exits math mode
\usepackage[normalem]{ulem} % provides \sout
\usepackage{lscape} % for page rotation

% Custom commands to clean the code up
\newcommand{\ord}[1]{\ensuremath{\langle#1\rangle}} % for your ordered sets; you can change back to < > if you want
\newcommand{\type}[2]{\ensuremath{\text{#1}_{#2}}} % for your types
\newcommand{\br}[1]{\ensuremath{\lbrack \thinspace #1 \thinspace \rbrack}} % for your bracketed elements
\newcommand{\arr}{\ensuremath{\rightarrow}} % shorter macro for the arrow
\newcommand{\stm}[1]{\ensuremath{\text{\sout{$#1$}}}} % a strikeout command that words in math mode

% commands for the three types you're using
\newcommand{\tone}{\type{t}{1}}
\newcommand{\etwo}{\type{e}{2}}
\newcommand{\ethree}{\type{e}{3}}

\begin{document}

\begin{landscape}
\scalebox{.96}{ % scales the entire contents
\begin{tikzpicture}[baseline=(current bounding box.center)]
\Tree
    [.TP
        [.DP
            [.\node(everyone){Everyone}; % label nodes you want to draw lines/arrows to or from
            ]
        ]
        [.T\1
            [.T
            ]
            [.AspP
                [.Asp
                ]
                [.\emph{v}P
                    [.\emph{v}
                    ]
                    [.VP
                        [.V hugs 
                        ]
                        [.DP 
                            [.\node(someone){someone};
                            ]
                        ]
                    ] 
                ]
            ]
        ]
    ]
\begin{scope}[xshift=5.5cm,yshift=-4cm] % use scope to be able to shift parts of the tikzpicture around and scale them independently of the rest of the tikzpicture
\node {\Huge$\Rightarrow$}; % put the arrow in a node and make it \Huge
\end{scope}
\begin{scope}[xshift=9cm,scale=.8] % shift the first tree 9 cm to the right
\Tree
    [.\node(root-surface){$\ord{\tone, \br{\emptyset}, \br{\emptyset}}$};
        [.\node(NPleft-surface){$\ord{(\etwo \arr \tone) \arr \tone), \br{\ethree}}$};
            [.\node(universal-surface){$\forall$};
            ]
        ]
        [.$\ord{(\etwo \arr \tone), \br{\stm{\ethree}}, \br{\emptyset}}$
            [.\node(ne-surface){$\etwo$};
            ]
            [.\node(NPright-surface){$\ord{\tone, \br{\etwo}, \br{\emptyset}}$};
                [.\node(VPleft-surface){$\ord{(\ethree \arr \tone) \arr \tone, \br{\etwo}, \br{\emptyset}}$};
                    [.\node(existential-surface){$\exists$};
                    ]
                ]
                [.$\ord{(\ethree \arr \tone), \br{\etwo}, \br{\stm{\ethree}}}$
                    [.\node(ue-surface){$\ethree$};
                    ]
                    [.$\ord{\tone, \br{\etwo}, \br{\ethree}}$
                        [.\node [circle,draw] (me-surface) {$\etwo$}; 
                        ]
                        [.$\ord{(\etwo \arr \tone), \br{\ethree}}$
                            [.$\ord{(\ethree \arr \etwo \arr \tone), \br{\emptyset}}$
                            ]
                            [. \node [circle,draw] (le-surface) {$\ethree$};
                            ]
                        ]
                    ]
                ]
            ]
        ]
    ]
\draw[semithick, dashed, ->, >=stealth] 
    (le-surface)..controls +(-1,-1) and +(0,-4) .. (ue-surface);
\draw[semithick, dashed, ->, >=stealth]
    (me-surface)..controls +(-1,-1) and +(0,-4) .. (ne-surface);
% the caption node is positioned relative to the scope
\node at (5,1.5) {\textbf{Surface Scope}};
% draw a blue ellipse around the nodes listed after fit =, tweak inner sep to make it slightly bigger/smaller
\node [draw=blue, ellipse, thick, inner sep=-4pt, fit = (root-surface) (NPleft-surface) (NPright-surface)] {}; 
\node [draw=blue, ellipse, thick, inner sep=-5pt, fit = (VPleft-surface) (le-surface)] {};
% position the label of the ellipses to relative to one of the named nodes in the tree
\node [above=1cm, right=1cm] at (NPright-surface) {\color{blue} NP}; 
\node [above=1.5cm, right=0.5cm] at (le-surface) {\color{blue} VP};
\end{scope}

\begin{scope}[xshift=9cm,yshift=-8cm,scale=.8] % the inverse scope tree is positioned 9 cm to the right and 8 cm down
\Tree
    [.$\ord{\tone, \br{\emptyset}}$
        [.$\ord{(\ethree \arr \tone) \arr \tone), \br{\emptyset}}$
            [.\node(existential-inverse){$\exists$};
            ]
        ]
        [.$\ord{(\ethree \arr \tone), \br{\stm{\ethree}}}$
            [.\node(ue-inverse){$\ethree$};
            ]
            [.\node[draw]{$\ord{\tone, \br{\ethree}}$};
                [.$\ord{(\etwo \arr \tone) \arr \tone), \br{\ethree}}$
                    [.\node(universal-inverse){$\forall$};
                    ]
                ]
                [.$\ord{(\etwo \arr \tone), \br{\ethree}}$
                    [.$\ord{(\ethree \arr \etwo \arr \tone), \br{\ethree}}$
                    ]
                    [.\node [circle,draw] (le-inverse) {$\ethree$};
                    ]
                ]
            ]
        ]
    ]
\draw[semithick, dashed, ->, >=stealth]
    (le-inverse)..controls +(-2,-1) and +(0,-4) .. (ue-inverse);
\node at (5,1) {\textbf{Inverse Scope}};
\end{scope}
% These are the red lines, drawn between nodes in different scopes
\draw[thick, color=red]
    (someone)..controls +(0,-2) and +(-1,-1)..(existential-inverse);
\draw[thick, color=red]
    (someone)..controls +(0,-2) and +(0,-3)..(existential-surface);
\draw[thick, color=red]
    (everyone)..controls +(0,-10) and +(-1,-1)..(universal-inverse);
\draw[thick, color=red]
    (everyone)..controls +(0,-9) and +(0,-8)..(universal-surface);
\end{tikzpicture}
}
\end{landscape}

\end{document}

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.