I'd like to clean up my tree by drawing an edge between parent nodes. In the following, I'd like to have the 0
nodes (which are children now) adjacent to the numbered nodes (ie on the "parent" level). How might I do this? Am I missing something simple? Thanks!
\documentclass{article}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={circle, draw, l sep=20pt, s sep=5 mm}
[0, green
[0, green]
[1, red
[0, green]
[2, red
[0, green]
[3, red]
]
[3, red
[0, green]
[2, red]
]
]
[2, red
[0, green]
[1, red
[0, green]
[3, red]
]
[3, red
[0, green]
[1, red]
]
]
[3, red
[0, green]
[1, red
[0, green]
[2, red]
]
[2, red
[0, green]
[1, red]
]
]
]
\end{forest}
\end{document}
by letting each 0
node be on the same level as the parents and connecting the parent.
That is, I'd like it to look something like
0 ----- 0
/ \
0 --- 1 2 --- 0
/ \
2 3
tier
s but in your tree the0
nodes occur at all levels.0
node, for example? As in adding two0
nodes at the top level, one with the remaining full tree, and one which is the final node?\documentclass{article} \usepackage{forest} \begin{document} \begin{forest} for tree={circle, draw, l sep=20pt, s sep=5 mm} [0, green [0, green,tier=murmel] [1, red [0, green,tier=murmel] [2, red [0, green] [3, red] ] [3, red [0, green] [2, red] ] ] (rest of your tree start with [2, red) \end{forest}\end{document}
but this doesn't look convincing to me. This is not because forest cannot do it, but because I do not understand your request.documentclass{article} \usepackage{forest} \begin{document}
and\end{document}
, show the current output and then the sketch of what you want to achieve.