I try to create treelike structures for basic arithmic with which students can learn to calculate. These trees should look like in the picture below just with more levels (to calculate more than one calculation).

[![enter image description here](https://i.stack.imgur.com/glwcY.jpg)](https://i.stack.imgur.com/glwcY.jpg)

To make it easier I want to define single elements with 3 squares (for the two summands and the solution) and a circle with the operator. So I defined a command which should give me this basic element.

```
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\usetikzlibrary{intersections}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{3d}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}

\newcommand{\tree}[4]{
\draw[shift=(#1)] (-1,1.75) rectangle node{\footnotesize #2} (-.5,2.25);
\draw[shift=(#1)] (1,1.75) rectangle node{\footnotesize #3} (1.5,2.25);

\draw[shift=(#1)] (-.75,1.75)--(-.75,1.25)--(.05,1.25);
\draw[shift=(#1)] (1.25,1.75)--(1.25,1.25)--(.45,1.25);
\draw[shift=(#1)] (0.25,1.25) circle  (.2);
\draw[shift=(#1)] (.25,1.25)--+(2pt,0pt)--+(-2pt,0pt);
\draw[shift=(#1)] (.25,1.05)--(.25,.75);

\draw[shift=(#1)] (0,.25) rectangle node{\footnotesize #4} (.5,.75);
}

\begin{document}
    \begin{tikzpicture}
        \tree{0,0}{100}{54}{8}
    \end{tikzpicture}
\end{document}

```

But the code above just keeps compiling without giving any error. Is there an easy way to define a precontructed TikZpicture which can just be inserted into another figure?

Greetings Laminator