langsci / 259

Müller, Stefan et al. (eds): Head-Driven Phrase Structure Grammar: The handbook
Creative Commons Attribution 4.0 International
22 stars 7 forks source link

types at the bottom come out scrambled if they are not aligned with tier directive (case.tex) #117

Closed stefan11 closed 3 years ago

stefan11 commented 3 years ago
\begin{forest}
type hierarchy
[case
  [morph-case, for children={l sep+=2\baselineskip}
    [nom,name=nom]
    [gen,name=gen
      [lgen,edge to=lexical,tier=max]]
    [dat
      [ldat,edge to=lexical,tier=max]]
    [acc,name=acc
      [lacc,edge to=lexical,tier=max]]]
  [syn-case, for children={l sep+=2\baselineskip}
    [lexical,name=lexical]
    [structural
      [snom,edge to=nom,tier=max]
      [sgen,edge to=gen,tier=max]
      [sacc,edge to=acc, calign with current,tier=max]]]]
\end{forest}

It works the way it is, but using tier is probably overkill and there is a way to do this properly.

sasozivanovic commented 3 years ago

l sep measures the distance from the edge of a node, so "g"s and "l"s matter (depth-wise and height-wise, respectively). In this case, it is better to add to "l" -- but remember that "l sep" is set on the parent, and "l" on the children. So it is easiest to simply add to "l" on the third level.

\begin{forest}
  type hierarchy,
  for level={3}{l+=2\baselineskip},
  [case
    [morph-case
      [nom,name=nom]
      [gen,name=gen
        [lgen,edge to=lexical]]
      [dat
        [ldat,edge to=lexical]]
      [acc,name=acc        [lacc,edge to=lexical]]]
    [syn-case
      [lexical,name=lexical]
      [structural
        [snom,edge to=nom]
        [sgen,edge to=gen]
        [sacc,edge to=acc, calign with current]]]]
\end{forest}

Before I figured this out, I was playing with adjusting the actual node dimensions, making them uniform. How does this look like to you? Here's the result ... to my eye, it actually looks better! If you prefer it as well, I can change the forest setup.

\begin{forest}
  type hierarchy,
  % for level={2}{l sep+=2\baselineskip},    % this works, too
  for level={3}{l+=2\baselineskip},
  for tree={content format/.wrap value={\noexpand\raisebox{0pt}[1.2ex][0pt]{#1}}},
  [case
    [morph-case
      [nom,name=nom]
      [gen,name=gen
        [lgen,edge to=lexical]]
      [dat
        [ldat,edge to=lexical]]
      [acc,name=acc
        [lacc,edge to=lexical]]]
    [syn-case
      [lexical,name=lexical]
      [structural
        [snom,edge to=nom]
        [sgen,edge to=gen]
        [sacc,edge to=acc, calign with current]]]]
\end{forest}
stefan11 commented 3 years ago

Thanks! I tried both options: grafik

I think the second one is better for "syn-case" but it is too close for "morph-case". It almost touches the "h". And the "d" of "ldat". I think I prefer the first. Maybe the truth is in the middle.