4

enter image description here

Hello! I am trying to insert an arrow with text parallel to the tree. Thanks!

    \documentclass[11pt,titlepage,oneside,openany]{book}
    \usepackage{forest}
    \begin{document}
    \begin{forest}
    [A, name=a[B][C[D][E ,name=e[F][G]]]]
    \end{forest}
    \end{document}
1
  • Instead of just posting an image, post the code for your tree in a minimal compilable document that people can work with. – Alan Munn Nov 12 '18 at 21:39
3

You did almost everything yourself, even naming the nodes. I only had to add one simple TikZ command.

\documentclass[11pt,titlepage,oneside,openany]{book}
\usepackage{forest}
\begin{document}
\begin{forest}
[A,name=a
 [B]
 [C
  [D]
  [E ,name=e
   [F]
   [G]
  ]
 ]
]
\draw[thick,-latex] ([xshift=1cm]a.north east) -- ([xshift=1cm]e.south east)
node[midway,sloped,above]{text on arrow};
\end{forest}
\end{document}

enter image description here

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.