I beg your pardon if I make some mistakes, I'm fully new here. I'm trying to do a presentation with Beamer about syntactic structures and I need to draw two trees. The second tree (which begins with ForceP) is a kind of zoom/split of a section of the first tree. I also need to link them with an arrow.

I've done it with two trees (drawn with forest) and a separate arrow with tikzpicture. Do you know how I can get it more precise? Perhaps using some anchors, tikzmark or labels in the trees? Thanks a lot!


%------- CODIFICA ------------------------------------
%---- LINGUISTICA -----------------------------------

 for children={no edge,replace by={[,append,
 delay={content/.wrap pgfmath arg={\csname @alph\endcsname{##1}.}{n()+##1}}
[CP,tikz={\node [draw,red,fit=()(!1)(AB)] {};}
[SpecCP] [C' [C$_0$] [IP,name=AB [SpecIP] [I' [I$_0$] [VP [,roof]]]]]]

[ForceP,tikz={\node [draw,red,fit to=tree] {};}
[Force' [Force$_0$] 
[\ldots [FinP [SpecFin] 
[Fin' [Fin$_0$] [IP [,roof]]]
\begin{tikzpicture}[remember picture, overlay]
 \draw [-Latex, red] (2.80,5) [out=75, in=230]to (5.9,4);

Here my result

  • You don't seem to be using the xlist style? – cfr Jul 11 '17 at 19:14
  • When you say 'more precise', what are you looking to do exactly? You could draw the two trees as one, by using a phantom root. This can be done with forest alone. (Well, of course, it is using tikz and so on, but I mean that you don't need anything additional.) – cfr Jul 11 '17 at 19:28

The simplest solution may be to use a phantom root and draw both trees as one.

\begin{frame}{Two in One}
    [, phantom, for children={fit=band}, s sep'+=20pt
      [CP, name=CP
          [IP, name=AB
      [ForceP, tikz+={
        \node (fit1) [draw, red, fit to={name=CP,1,name=AB}] {};
        \node (fit2) [draw, red, fit to=tree] {};
        \draw [-Latex, red] (fit1.east) [out=75, in=230]to (fit2.west);

two in one

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.