You have two errors in your code that exclude the possibility to have both trees on the same horizontal line:
- You have an empty line between the
forest environments which TeX interprets as a new paragraph. Remove that empty line or insert a %.
- Your
forest environments has empty lines in it. This prevents TeX from compiling your code at all as it breaks the forest parser. The same rule as for above is valid.
You now have both forest trees on the same horizontal line. As TeX sees the trees (the underlying TikZ pictures) as two big box which have their baseline at the bottom the roots of the trees are not vertically aligned.
You can change this with the baseline option (a forest option here, there also exist a TikZ baseline option). At any node you use the baseline option, the baseline of the whole tree is set. In this way, you can give the baseline option to the VP node in the first tree and the Det node in the second tree to vertically align the pictures at these node. Is the option given as an option to the forest environment, the option is applied to the root node.
If you want both trees in one picture (to make it easy to draw between them), the phantom option might be helpful. You may need to include a few phantom levels to align the sub-trees at different levels as in the example before.
Code
\documentclass{article}
\usepackage{forest}
\begin{document}
\begin{forest} baseline
[P1
[SN
[N[Mary]]]
[VP
[V[loves]]
[N[Luke]]
]]
\end{forest}\hspace{1cm}
\begin{forest} baseline
[P2
[NP
[Pro[This]]]
[VP
[V[is]]
[NP
[Det[a]]
[N[xx]]
]]]
\end{forest}
\end{document}
forestenvironment in a separateminipageenvironment. – Marco Daniel Nov 23 '13 at 16:03forestenvironment: a blank line makes a paragraph end. To TeX's eyes, aforestis just a big letter. – egreg Nov 23 '13 at 16:13forestenvironment. You code in its current form will cause errors during compilation, even if with the correct preamble. – Herr K. Nov 29 '13 at 19:08