I'm submitting a computational paper to an ACL-style journal. I need trees that have horizontally-aligned terminal nodes and no node labels (parser doesn't provide them). This question relates to this one; I took code from some comments (updated a little) resulting in trees that are short enough to fit in my paper, but they are terribly ugly.
MWE:
\documentclass[11pt,letterpaper]{article}
\usepackage[letterpaper]{geometry}
\usepackage{acl2012}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{amsmath}
\usepackage{forest}
\forestset{
nice empty nodes/.style={
for tree={
s sep=0.1em,
l sep=0.33em,
inner ysep=0.4em,
inner xsep=0.05em,
l=0,
calign=midpoint,
fit=tight,
where n children=0{
tier=word,
minimum height=1.25em,
}{},
where n children=2{
l-=1em,
}{},
parent anchor=south,
child anchor=north,
delay={if content={}{
inner sep=0pt,
edge path={\noexpand\path [\forestoption{edge}]
(!u.parent anchor)
-- (.south)\forestoption{edge label};}
}{}}
},
},
}
\begin{document}
\begin{forest}
nice empty nodes
[ [ [ [He] [swung] ] [ [at] [the] ] ] [ [ [brute] [\textbf{with}] ] [ [\textbf{his}] [, phantom ] [ [\textbf{sword}] [$.$] ] ] ] ]
\end{forest}
\begin{forest}
nice empty nodes
[ [He] [ [ [ [swung] [ [at] [ [the] [brute] ] ] ] [ [\textbf{with}] [ [\textbf{his}] [\textbf{sword}] ] ] ] [$.$] ] ]
\end{forest}%
\end{document}
I spent about 15 hours on the issue, as did 3 or 4 others in my group, so it seems like a toughy...
Desiderata:
- straight lines between the root node and the leftmost and rightmost terminal nodes
- a tree that is as small as possible, vertically
- Word spacing that's not too crazy (doesn't have to be completely even)
- no weird things happening with changing line depth based on variations in height of symbols (e.g., periods and tall letters)
Potentially something that looks like the next tree, but that doesn't require so much manual tikz time and isn't so vertically tall...
Any advice?
calign=fixed edge angles
andcalign primary angle=-75,calign secondary angle=75,
under your current linecalign=midpoint,
and continue adapting the other features. I have no idea what the rest of your code does in detail, but I hope you do.