0

I have been trying to color some nodes with filled dots. But I am stuck, following the forest package guideline, I was only able to fill only first and two rows.

What I am trying to do:

whatI want to do

I was only able to do first and second one. Here's my minimal code:

\documentclass[border=3mm]{standalone}
\usepackage[linguistics,edges]{forest} 
\forestset{
ned/.style={%
    for tree={calign=fixed edge angles},
    delay={%
      where content={}{%
        shape=coordinate,
        for nodewalk={%
          Nodewalk={%
            on invalid=fake,
          }{%
            parent,
          }{%
            for children={anchor=north},
          }
        }{},
      }{},
    },
},
}

\begin{document}

\begin{forest}
ned
[DP
  [
    [
      [pro]
      [
        [VP
          [NP\\ t\textsubscript{1}]
          [V\\Tuttukları]
        ]
        [T]
      ]
    ]
    [C]
  ]
  [
    [NP\\aşçı]
    [D]
  ]
]
\path[fill=red] (.parent anchor) circle[radius=2pt];
\path[fill=red] (!1.child anchor) circle[radius=2pt];
\end{forest}

\end{document}
1

1 Answer 1

2

To make it easier to understand I chose one color per node (you can change them to red according to your needs).

From top to bottom:

\path[fill=red] (.parent anchor) circle[radius=2pt];
\path[fill=black] (!1.child anchor) circle[radius=2pt];
\path[fill=green] (!11.child anchor) circle[radius=2pt];
\path[fill=blue] (!112.child anchor) circle[radius=2pt];
\path[fill=yellow] (!1121.south) circle[radius=2pt];
\path[fill=orange] (!11212.child anchor) circle[radius=2pt];

enter image description here

MWE:

\documentclass[border=3mm]{standalone}
\usepackage[linguistics,edges]{forest} 
\forestset{
ned/.style={%
    for tree={calign=fixed edge angles},
    delay={%
      where content={}{%
        shape=coordinate,
        for nodewalk={%
          Nodewalk={%
            on invalid=fake,
          }{%
            parent,
          }{%
            for children={anchor=north},
          }
        }{},
      }{},
    },
},
}

\begin{document}

\begin{forest}
ned
[DP
  [
    [
      [pro]
      [
        [VP
          [NP\\ t\textsubscript{1}]
          [V\\Tuttukları]
        ]
        [T]
      ]
    ]
    [C]
  ]
  [
    [NP\\aşçı]
    [D]
  ]
]
\path[fill=red] (.parent anchor) circle[radius=2pt];
\path[fill=black] (!1.child anchor) circle[radius=2pt];
\path[fill=green] (!11.child anchor) circle[radius=2pt];
\path[fill=blue] (!112.child anchor) circle[radius=2pt];
\path[fill=yellow] (!1121.south) circle[radius=2pt];
\path[fill=orange] (!11212.child anchor) circle[radius=2pt];
\end{forest}

\end{document}

I think it is self-explanatory, otherwise let me know.

You must log in to answer this question.

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