![Einfärben aller Knoten, die einem bestimmten Endknoten folgen](https://rvso.com/image/420022/Einf%C3%A4rben%20aller%20Knoten%2C%20die%20einem%20bestimmten%20Endknoten%20folgen.png)
Ich habe versucht, einige Knoten mit ausgefüllten Punkten einzufärben. Aber ich stecke fest. Gemäß der Richtlinie des Forest-Pakets konnte ich nur die erste und zwei Zeilen ausfüllen.
Was ich versuche zu tun:
Ich konnte nur das erste und zweite ausführen. Hier ist mein minimaler 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}
Antwort1
Zum besseren Verständnis habe ich eine Farbe pro Knoten gewählt (Sie können sie je nach Bedarf auf Rot ändern).
Von oben nach unten:
\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}
Ich denke, es ist selbsterklärend, andernfalls lassen Sie es mich wissen.