![Colorear todos los nodos que siguen a un nodo terminal específico](https://rvso.com/image/420022/Colorear%20todos%20los%20nodos%20que%20siguen%20a%20un%20nodo%20terminal%20espec%C3%ADfico.png)
He estado intentando colorear algunos nodos con puntos rellenos. Pero estoy estancado, siguiendo las pautas del paquete forestal, solo pude llenar la primera y dos filas.
Lo que estoy tratando de hacer:
Sólo pude hacer el primero y el segundo. Aquí está mi código mínimo:
\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}
Respuesta1
Para que sea más fácil de entender, elegí un color por nodo (puedes cambiarlos a rojo según tus necesidades).
De arriba a abajo:
\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];
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}
Creo que se explica por sí mismo; de lo contrario, házmelo saber.