4

I'm new to the forest package. Essentially, I am trying to get something that will look like this:

enter image description here

The branching angles are large and matching for every node, even the empty one, and there are no gaps between the branches. So far, what I have for my tree is this:

 \forestset{ xlist/.style={ phantom, for children={no edge,replace by={[,append,
 delay={content/.wrap pgfmath arg={\csname @alph\endcsname{##1}.}{n()+#1}}
 ]}}
 },
 xlist/.default=0
 }

\begin{forest}
 [vP, for tree={parent anchor=south, child anchor=north},
 delay={where content={}{shape=coordinate}{}}
 [DP[\textit{il mare}]]
 [
 [v$_{\textrm{\footnotesize{\sc caus}}}$[\textit{si}]]
 [SC
 [DP[\textit{la casa},tier=word1]]
 [V$_{\textrm{\footnotesize{Adjectival}}}$[\textit{bruciata}, tier=word1]]
 ]
 edge={}]
 ]
\end{forest} 

which achieves this result:

enter image description here

thank you everyone for the help!

1
  • Welcome to TeX.SE! I upvoted your question as it is good, includes code and includes images so thank you! One thing I would improve for your questions in the future (which hopefully there are many and hopefully answers too!) is to make the code you include compile i.e. begin with your \documentclass{} and end with \end{document}. It is okay in this case as it can be built into one easily by those who know the forest package as the missing stuff is easy enough to know, but just a tip for the future in case it is not so simple, hope you enjoy it here!
    – JamesT
    Commented Mar 30, 2023 at 9:57

2 Answers 2

2

The forest manual provides the nice empty nodes style, which is modified slightly in the code below. Note that your xlist style is not actually used in your code.

enter image description here

\documentclass{article}
\usepackage{forest}

\forestset{
  nice empty nodes/.style={
    for tree={calign=fixed edge angles, calign angle=60},
    delay={where content={}{shape=coordinate,
    for current and siblings={anchor=north}}{}}
  }
}

\begin{document}

\begin{forest}
 [vP, for tree={parent anchor=south, child anchor=north}, nice empty nodes
 [DP[\textit{il mare}]]
 [
 [v$_{\textrm{\footnotesize{\sc caus}}}$[\textit{si}]]
 [SC
 [DP[\textit{la casa},tier=word1]]
 [V$_{\textrm{\footnotesize{Adjectival}}}$[\textit{bruciata}, tier=word1]]
 ]
 edge={}]
 ]
\end{forest}

\end{document}
0

Edit:

  • For your tree I would use linguistics library. Using it the code is much shorter and simple.
  • The for tree option if n children=0{font=\itshape}{} is for text in the italic shape.
  • The command \textsubscript is for subscript text:
\documentclass[margin=3mm]{standalone}
\usepackage[linguistics]{forest}    % v2.1.5

\begin{document}
    \begin{forest}
for tree={inner sep=2pt, 
%          anchor=center
           if n children=0{font=\itshape}{},
          }
[vP
    [DP
        [il mare]
    ]
    [, coordinate
        [v\textsubscript{\textsc{caus}}
            [si]
        ]
        [SC
            [DP
                [la casa]
            ]
            [V\textsubscript{Adjectival}
                [bruciata]
            ]
            ]
    ]
]
    \end{forest}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .