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, 2018 at 21:39

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .