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!

1 Answer 1

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

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

You must log in to answer this question.

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