2

in reference to this post, I have a follow-up question. What I need to do is basically something like the following:

enter image description here

That's my attempt:

\documentclass[12pt]{article}

\usepackage[linguistics]{forest}
\usetikzlibrary{decorations.pathmorphing}
\forestset{%
/tikz/squiggly/.style={decorate, decoration={snake, amplitude=.5mm, segment length=2mm}},
wiggly/.style={edge=squiggly},
move me/.style n args=2{%
before drawing tree={%
  x+=#1,
  y+=#2,
     },
  },
 }

\begin{document}

\begin{forest}
[P\textsubscript{\scshape [rel]}, move me={-150pt}{0pt}
    [{\itshape bla}, wiggly, move me={200pt}{0pt}]           
    [D\textsubscript{\scshape [+def]}, move me={-150pt}{0pt}
        [{\itshape bla}, wiggly, move me={200pt}{0pt}]
        [{\itshape bla, no edge, move me={80pt}{-20pt}]
        [{\itshape \textfishhookr a} <P\textsubscript{\scshape [rel]}, D\textsubscript{\scshape [+def, +fem]}>, no edge, move me={-30pt}{-40pt}]
        [, phantom, calign with current]
        [NP, move me={-150pt}{-15pt}
                [{\hspace{2cm}}, roof, move me={-150pt}{-15pt}]
            ]
        ]
    ]

 \end{forest}

 \end{document}

But it runs into an error that I can't figure out. Any ideas?

Thanks!

  • One typo is immediately visible: Replace {\itshape bla, no edge by {\itshape bla}, no edge. – gernot Oct 26 '16 at 14:25
  • You will also need tipa or some other package, that provides the symbol \textfishhookr. – gernot Oct 26 '16 at 14:33
  • The erroneous part is <P\textsubscript{\scshape [rel]}, D\textsubscript{\scshape [+def, +fem]}>. If you remove it, it compiles without errors. So recheck its syntax. I'm not completely sure about your intentions regarding < and >. – gernot Oct 26 '16 at 14:44
2

I would not use move me in this case either, but would also create a single node. However, I'd probably create it in the regular way as part of the tree. However, Sašo is the expert here, so there is probably some good reason not to do it my way!

Caveat emptor ...

wiggly and squiggly are defined as before, the node content is from Sašo's answer. parent to=<node> draws a squiggly line from the current node's parent anchor to the target node's child anchor. The phantom node and calign=fixed edge angles help with the spacing. We override the maths mode for the 'blanode usingplain content, aligning things at the centre and using atier` to ensure horizontal alignment of the terminal nodes.

\documentclass[border=10pt,multi,tikz]{standalone}
\usepackage[linguistics]{forest}
\usetikzlibrary{decorations.pathmorphing}
\forestset{%
  /tikz/squiggly/.style={
    decorate,
    decoration={snake, amplitude=.5mm, segment length=2mm}},
  wiggly/.style={edge=squiggly},
  parent to/.style={
    tikz+={\draw [squiggly] (.parent anchor) -- (#1.child anchor);}
  },
}

\begin{document}
\begin{forest}
  where n children=0{tier=terminus}{},
  [P\textsubscript{\scshape [rel]}
    [bla\\bla\\bla, plain content, align=c, font=\itshape, wiggly]
      [D\textsubscript{\scshape [+def]}, parent anchor=south east, child anchor=120, calign=fixed edge angles, parent to=!r1
      [, phantom]
      [NP
        [{\hspace*{1cm}}, roof]
      ]
    ]
  ]
\end{forest}
\end{document}

another wiggly one

3

The example does not compile because {\itshape \textfishhookr a} <P\textsubscript{\scshape [rel]}, D\textsubscript{\scshape [+def, +fem]}>} contains a comma. Forest and TikZ therefore assume that D\textsubscript{\scshape [+def, +fem]}>} is a key name. Solution: surround that content by braces.

But to draw the tree from the question, I would, rather than making three bla nodes and move everything manually, create a single tikz (i.e. non-forest) node bla, position it semi-manually, and connect the nodes to it manually (using \draw inside forest's tikz key).

\documentclass[12pt]{article}
\usepackage{tipa}

\usepackage[linguistics]{forest}
\usetikzlibrary{decorations.pathmorphing}
\forestset{%
  /tikz/squiggly/.style={
    decorate,
    decoration={snake, amplitude=.5mm, segment length=2mm}},
  to bla/.style={
    phantom,
    tikz+={\draw[squiggly] (!u)--(bla);},
  }
}

\begin{document}
\begin{forest}
  [P\textsubscript{\scshape [rel]}
    [,to bla]
    [D\textsubscript{\scshape [+def]}
      [,to bla]
      [NP
        [{\hspace*{1cm}}, roof]
      ]
    ]
  ]
  \path
    (!r) |-
    node(bla)[align=left,anchor=north east,
      shift={(-1em,2ex)},font=\itshape]
      {bla\\bla\\bla}
    (!lll);
\end{forest}
\end{document}

Result

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.