0

I've been trying to draw a tree like this:

enter image description here

But I came across the problem that the node names are apparently too long... So the code below doesn't work. (If you replace $\lambda x.\lambda e. \text{eating}(e) \land \text{agent}(e,x) \land \text{theme}(e, \textsc{food}) \land \textsc{benefactive}(e,\text{wife})$ with aaa, it will work.) Is there any way to fix this?

\documentclass[11pt]{article}
\usepackage{linguex}
%\usepackage{cgloss}
\usepackage[linguistics]{forest}
\begin{document}

\ex.
\begin{forest}
[\textbf{VoiceP}
    [he]
    [$\lambda x.\lambda e. \text{eating}(e) \land \text{agent}(e,x) \land \text{theme}(e, \textsc{food}) \land \textsc{benefactive}(e,\text{wife})$
       [T\\will ]
       [VP
          [V\\eat ]
          [DP [D\\a ] [NP [N\\burger ]]]
       ]
    ]
]
\end{forest}

\end{document}

(Source of the code above before my modifications: https://amunn.github.io/assets/latex/overleaf-trees.pdf)

3
  • 1
    Your code does not compile. What is cgloss?
    – Sandy G
    Apr 2 at 22:26
  • @SandyG it's discussed here. But I guess for the purpose of this question, it's not important, you can delete the line with cgloss.
    – user181940
    Apr 2 at 23:28
  • It still doesn't compile.
    – Sandy G
    Apr 3 at 0:18

1 Answer 1

3

Inside forest nodes commas differs node content from eventual local style settings. So in the cases, when node content should contain commas, whole node content had to be encapsulated in curly braces:

\documentclass[11pt]{article}
%\usepackage{linguex}
\usepackage{amsmath}
\usepackage[linguistics]{forest}

\begin{document}

\begin{forest}
for tree = {
    align=center,
            }
[\textbf{VoiceP}
    [he]
    [${\lambda x.\lambda e. \text{eating}(e) \land \text{agent}(e,x)}$\\
     ${\land\, \text{theme}(e,\textsc{food}) \textsc{benefactive}(e,\text{wife})}$, draw
       [T\\will ]
       [VP
          [V\\eat ]
          [DP   [D\\a ] 
                [NP 
                    [N\\burger ]
                ]
          ]
       ]
    ]
]
\end{forest}

\end{document}

enter image description here

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.