I have the following trees and I want the lines parallel to the red lines to be straight lines. Right now they are two separate lines but it should be one straight line. Is this possible?
\documentclass{article}
\usepackage{forest}
\useforestlibrary{linguistics}
\forestapplylibrarydefaults{linguistics}
% specification for all trees, "default preamble" appends to existing specification.
% The version with apostrophe replaces it.
\forestset{default preamble'={
for tree={align=center,parent anchor=south, child anchor=north,anchor=north,base=bottom},
% This would align trees to the baseline. We do not want this for TAG
% where several trees have to be aligned with respect to their center.
% before drawing tree={
% sort by=y,
% for min={tree}{baseline}
% }
}}
\forestset{
declare dimen={child anchor yshift}{0pt},
adjust childrens child anchors/.style={
if n children>=2{
before packing={
tempdima/.max={max_y}{children},
for children={
child anchor yshift=tempdima()-max_y()
},
}
}{}
},
default preamble={
for tree={
edge path'={(!u.parent anchor)--([yshift=\forestoption{child anchor yshift}].child anchor)},
adjust childrens child anchors
}
},
}
\forestset{
empty nodes/.style={
delay={where content={}{shape=coordinate,for siblings={anchor=north}}{}}
},
sm edges without translation/.style={for tree={parent anchor=south, child anchor=north,base=bottom},
where n children=0{tier=word}{}
}
}
\begin{document}
\begin{forest}
empty nodes
[{}
[X \\ {[\textit{u}F]}]
[{}
[Y \\ {[F v]}, roof]]]
\end{forest}
\begin{forest}
sm edges without translation, empty nodes
[{}
[X \\ {[\textit{u}F v]}]
[{}
[Y \\ {[F v]}, roof]]]
\end{forest}
\end{document}
Edit:
The problem seems to be related to the roof.

\documentclass{article}
\usepackage{forest}
\useforestlibrary{linguistics}
\forestapplylibrarydefaults{linguistics}
\begin{document}
\begin{forest}
nice empty nodes
[{}
[X \\ {[\textit{u}F]}]
[{}
[Y \\ {[F v]}, roof]]]
\end{forest}
\hspace{2cm}
\begin{forest}
nice empty nodes
[{}
[X \\ {[\textit{u}F]}]
[{}
[Y]
[Z]]]
\end{forest}
\end{document}


[Y ...by[Y] [Z]the lines are ok. – Stefan Müller Aug 31 '18 at 15:45roofwhich, I guess (?), may not be designed for this. Are roofs usually expected to line up? @AlanMunn ? – cfr Sep 02 '18 at 00:28roofor not.roofis just irrelevant as far as I can see. @AlanMunn – cfr Sep 02 '18 at 01:16\phantom{X}to either side of the Y in theroofnode. – Alan Munn Sep 02 '18 at 02:27fixed edge anglesaligns the.child anchorand not.parent last, which is what Stefan wants it to do. Since that would not generally be what was wanted, I don't imagine this would be easy to implement at all. And it would be wrong for any other value of n anyway. At any rate, any non-fudgy solution can't possibly be worth it, I don't think, so a fudge is the best solution here. IMNSHO. – cfr Sep 02 '18 at 03:13{[F v]}. What I could play with to get the angle right is the hight of the triangle. – Stefan Müller Sep 02 '18 at 17:32.parent lastrather than.parentor.northas.child anchor, even though it isn't. The edge angles are equal. The path to the child anchor is perfectly straight. But that path is not part of the roof. – cfr Sep 02 '18 at 23:24