4

I can do the following drawings of Board:

\documentclass{article}
\usepackage{skak}
\usepackage{chessboard}
\let\boardfont\undefinedcommand
\usepackage{diagram}

\begin{document}
\setboolean{showcomputer}{false}
\setboolean{piececounter}{false}
\specialdiagnum{}

\begin{diagram}[4x4]
\pieces{wDa3, wDb1, wDc4, wDd2}
\end{diagram}
\begin{diagram}[4x4]
\pieces{wDb4}
\end{diagram}

\end{document}

But, as do the tree of possibilities:enter image description here

  • 3
    Please stylize the code of question. – pushpen.paul Aug 21 '14 at 18:58
  • I recommend setting things up so that you avoid the use of metafont source if possible. Right now, your document uses chess pieces in metafont form rather than the type1 versions of the fonts. If you are creating PDF, it would be better by far to use the type1 versions. – cfr Aug 21 '14 at 20:57
  • @cfr: the diagram package has the metafont fonts hardcoded. It is not easily possible to switch to type1 fonts. – Ulrike Fischer Aug 22 '14 at 14:46
  • @UlrikeFischer Oh. That's a shame. – cfr Aug 22 '14 at 16:40
  • 2
    Could you please review answers to your other questions, benedito? In particular, you've received some truly oustanding answers to How to make dominoes falling? You should accept your favourite one. That's the best way to say "thank you", on TeX.SX. – jubobs Aug 23 '14 at 10:25
5

Here's something to get you started, using tikz and the idea of trees

screenshot

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[tikz]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[
        level 1/.style={sibling distance=3.5cm},
        level 2/.style={sibling distance=2.5cm},
        level distance=2cm,
    ]
    \node {\includegraphics[width=2cm]{example-image}}
    child {
        node {\includegraphics[width=2cm]{example-image-a}}
        child {node {\includegraphics[width=2cm]{example-image-b}}}
        child {
            node {\includegraphics[width=2cm]{example-image-b}}
            child {node {\includegraphics[width=2cm]{example-image-c}}}
        }
    }
    child {
        node {\includegraphics[width=2cm]{example-image-a}}
        child {
            node {\includegraphics[width=2cm]{example-image-b}}
            child {
                node {\includegraphics[width=2cm]{example-image-c}}
                child {node {\includegraphics[width=2cm]{example-image}}}
            }
        }
    }
    child {
        node {\includegraphics[width=2cm]{example-image-a}}
        child {
            node {\includegraphics[width=2cm]{example-image-b}}
            child {
                node {\includegraphics[width=2cm]{example-image-c}}
                child {node {\includegraphics[width=2cm]{example-image}}}
            }
        }
    }
    child {
        node {\includegraphics[width=2cm]{example-image-a}}
        child {
            node {\includegraphics[width=2cm]{example-image-b}}
            child {node {\includegraphics[width=2cm]{example-image-c}}}
        }
        child {node {\includegraphics[width=2cm]{example-image-b}}}
    };
\end{tikzpicture}


\end{document}

and something that does the borders:

screenshot

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass[tikz]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[
        level 1/.style={sibling distance=3.5cm,},
        level 2/.style={sibling distance=2.5cm},
        special/.style={draw=red,thick,double,inner sep=0mm},
        level distance=3cm,
        line width=3,
    ]
    \node {\includegraphics[width=2cm]{example-image}}
    child {
        node {\includegraphics[width=2cm]{example-image-a}}
        child {node {\includegraphics[width=2cm]{example-image-b}}}
        child {
            node {\includegraphics[width=2cm]{example-image-b}}
            child {node {\includegraphics[width=2cm]{example-image-c}}}
        }
    }
    child {
        node {\includegraphics[width=2cm]{example-image-a}}
        child {
            node {\includegraphics[width=2cm]{example-image-b}}
            child {
                node {\includegraphics[width=2cm]{example-image-c}}
                child {node[special] {\includegraphics[width=2cm]{example-image}}}
            }
        }
    }
    child {
        node {\includegraphics[width=2cm]{example-image-a}}
        child {
            node {\includegraphics[width=2cm]{example-image-b}}
            child {
                node {\includegraphics[width=2cm]{example-image-c}}
                child {node[special]{\includegraphics[width=2cm]{example-image}}}
            }
        }
    }
    child {
        node {\includegraphics[width=2cm]{example-image-a}}
        child {
            node {\includegraphics[width=2cm]{example-image-b}}
            child {node {\includegraphics[width=2cm]{example-image-c}}}
        }
        child {node {\includegraphics[width=2cm]{example-image-b}}}
    };
\end{tikzpicture}


\end{document}

Tweak as you see fit :)

6

You could always, of course, use forest:

chess in the forest

\documentclass[tikz]{standalone}
\usepackage{forest}
\usepackage{skak}
\usepackage{chessboard}
\let\boardfont\undefinedcommand
\usepackage{diagram}

\begin{document}
\setboolean{showcomputer}{false}
\setboolean{piececounter}{false}

\specialdiagnum{}
\begin{forest}
  for tree={
    edge path={
        \noexpand\path[\forestoption{edge}, shorten <=-15pt, line width=2.5pt] (!u.parent anchor) -- (.child anchor)\forestoption{edge label};
    },
  }
  [{\begin{diagram}[4x4]\end{diagram}}
    [{\begin{diagram}[4x4]\pieces{wDa4}\end{diagram}}
      [{\begin{diagram}[4x4]\pieces{wDa4, wDc3}\end{diagram}}]
      [{\begin{diagram}[4x4]\pieces{wDa4, wDd3}\end{diagram}}
        [{\begin{diagram}[4x4]\pieces{wDa4, wDd3, wDb2}\end{diagram}}]
      ]
    ]
    [{\begin{diagram}[4x4]\pieces{wDb4}\end{diagram}}
      [{\begin{diagram}[4x4]\pieces{wDb4, wDd3}\end{diagram}}
        [{\begin{diagram}[4x4]\pieces{wDb4, wDd3, wDa2}\end{diagram}}
          [{\begin{diagram}[4x4]\pieces{wDb4, wDd3, wDa2, wDc1}\end{diagram}}]
        ]
      ]
    ]
    [{\begin{diagram}[4x4]\pieces{wDc4}\end{diagram}}
      [{\begin{diagram}[4x4]\pieces{wDc4, wDa3}\end{diagram}}
        [{\begin{diagram}[4x4]\pieces{wDc4, wDa3, wDd2}\end{diagram}}
          [{\begin{diagram}[4x4]\pieces{wDc4, wDa3, wDd2, wDb1}\end{diagram}}]
        ]
      ]
    ]
    [{\begin{diagram}[4x4]\pieces{wDd4}\end{diagram}}
      [{\begin{diagram}[4x4]\pieces{wDd4, wDa3}\end{diagram}}
        [{\begin{diagram}[4x4]\pieces{wDd4, wDa3, wDc2}\end{diagram}}]
      ]
      [{\begin{diagram}[4x4]\pieces{wDd4, wDb3}\end{diagram}}]
    ]
  ]
\end{forest}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.