TeX - LaTeX Asked on March 19, 2021
I am building a chess repertoire and would like to visualise it as a tree using TikZ.
Below is an example of what I would like do achieve (source: https://kevinbinz.com/2015/02/26/decision-trees-in-chess/)
Exact font, color code, node decoration and arrow shape are irrelevant.
Note. Any data can be used in the answer.
This should be enough to get you started:
documentclass{article}
usepackage{forest}
forestset{end node/.style={draw,rectangle, fill=green!30,minimum width=1cm},
chess tree/.style={for tree={align=center,edge={-latex},s sep=1cm,l sep=1cm,
where n children=0{end node, edge={-}}{delay={draw, circle,minimum size=1cm,
if={iseven(level())}{fill=white}{fill=black!20}}}}},
move/.style={if n=1{edge label={node[midway,left]{#1}}}
{edge label={node [midway, right]{#1}}}}}
begin{document}
begin{forest}chess tree
[
[,move=Be3,
[,move=g5
[{[1a]-3}]
]
]
[,move=Bh6
[{[2a]-2}]
]
]
end{forest}
end{document}
Correct answer by Alan Munn on March 19, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP