3

I'm using forest and I would like to circle only a portion of my node. For example, in the tree below:

\documentclass{article}
\usepackage{forest}

\begin{document}

\begin{forest} 
[{\scshape Bla1 Bla2} 
     [{\scshape Blu1 Blu2} [blu1 blu2] ]
[bla1 bla2]]
\end{forest}

\end{document}

I would like to circle blu2 only and then draw an arrow to bla2.

Does anybody have any idea of to get that? I checked the forest package, but it seems that it only allows for entire nodes to be circled.

Thanks!

5

You can use tikzmark's \subnode. For example,

\documentclass[border=10pt]{standalone}
\usepackage{forest}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{forest}
  [{\scshape Bla1 Bla2}
    [{\scshape Blu1 Blu2}
      [blu1 \subnode{blu2}{blu2}]
    ]
    [bla1 \subnode{bla2}{bla2}]
  ]
\end{forest}
\begin{tikzpicture}[remember picture, overlay]
  \node [draw,fit=(blu2),circle,inner sep=-1.5pt] {};
  \draw [->] (blu2) -- (bla2);
\end{tikzpicture}
\end{document}

circle & arrow

  • Thanks! I really need to learn how to use the tikz package. – RobertP. Jun 13 '17 at 16:38
  • @RobertP. If you're using Forest, you are already using it ;). – cfr Jun 13 '17 at 22:26

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.