Mehrere Waldbäume anordnen mit \subfigure{}

Mehrere Waldbäume anordnen mit \subfigure{}

Ich möchte meine Bäume 2 x 2 anordnen. Stattdessen erhalte ich Folgendes:

Bildbeschreibung hier eingeben

Was mache ich falsch? Ich finde meinen Fehler nicht.

\documentclass[a4paper,11pt]{article}
\usepackage{tikz}
\usepackage{subfigure}
\usepackage{array}

\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{forest}
\begin{document}
\begin{figure}[htbp]
\begin{tabular}{C{.48\textwidth}C{.48\textwidth}}
\subfigure [Subfigure 1] {
\resizebox{0.4\textwidth}{!}{%
\begin{forest}
for tree={delay={where content={}{content={\phantom{00}}}{}},s sep+=5mm,l+=5mm}
[,circle,fill=black,inner sep=1mm
  [,circle,fill=red,inner sep=0.5mm
        [,circle,draw,red,inner sep=0.25mm,edge={red}
        [,circle,draw,red,inner sep=0.25mm,edge={red}]
     ]
     [,circle,draw,red,inner sep=0.5mm
        [,circle,draw,red,inner sep=0.25mm,edge={red}]
     ] 
  ]
  [,circle,fill=blue,inner sep=0.5mm
     [,circle,draw,blue,inner sep=0.25mm,edge={blue}
     ] 
  ]
  [,circle,fill=green,inner sep=0.5mm]
  [,circle,fill=orange,inner sep=0.5mm
  ]
]
\end{forest}
}}&
\subfigure [Subfigure 2] {
    \resizebox{0.4\textwidth}{!}{%
\begin{forest}
for tree={delay={where content={}{content={\phantom{00}}}{}},s sep+=5mm,l+=5mm}
[,circle,fill=black,inner sep=1mm
  [,circle,fill=red,inner sep=0.5mm
     [,circle,draw,red,inner sep=0.25mm,edge={red}]
     [,circle,draw,red,inner sep=0.5mm 
     ] 
  ]
  [,circle,fill=blue,inner sep=0.5mm
     [,circle,draw,blue,inner sep=0.25mm,edge={blue}
        [,circle,draw,blue,inner sep=0.25mm,edge={blue}]
     ]
     [,circle,draw,blue,inner sep=0.25mm,edge={blue}
     ] 
  ]
  [,circle,fill=green,inner sep=0.5mm  
  ]
  [,circle,fill=orange,inner sep=0.5mm
  ]
]
\end{forest}
}}\
\subfigure [Subfigure 3]{
    \resizebox{0.4\textwidth}{!}{%
\begin{forest}
for tree={delay={where content={}{content={\phantom{00}}}{}},s sep+=5mm,l+=5mm}
[,circle,fill=black,inner sep=1mm
  [,circle,fill=red,inner sep=0.5mm]
  [,circle,fill=blue,inner sep=0.5mm]
  [,circle,fill=green,inner sep=0.5mm
        [,circle,draw,green,inner sep=0.25mm,edge={green}]
  ]
  [,circle,fill=orange,inner sep=0.5mm
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}]
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}
            [,circle,draw,orange,inner sep=0.25mm,edge={orange}]    
        ] 
  ]
]
\end{forest}
}}
\subfigure [Subfigure 4] {
    \resizebox{0.4\textwidth}{!}{%
\begin{forest}
for tree={delay={where content={}{content={\phantom{00}}}{}},s sep+=5mm,l+=5mm}
[,circle,fill=black,inner sep=1mm
  [,circle,fill=red,inner sep=0.5mm]
  [,circle,fill=blue,inner sep=0.5mm]
  [,circle,fill=green,inner sep=0.5mm
        [,circle,draw,green,inner sep=0.25mm,edge={green}]
        [,circle,draw,green,inner sep=0.25mm,edge={green}]
  ]
  [,circle,fill=orange,inner sep=0.5mm
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}]
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}]
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}
            [,circle,draw,orange,inner sep=0.25mm,edge={orange}]
        ] 
        ] 
  ]
]
\end{forest}
}}
\end{tabular}
\end{figure}
\end{document}

Antwort1

In Deinem Code fehlt der doppelte Backslash \\und der zweite . (Siehe die markierten Stellen im Code weiter unten.)&

Bildbeschreibung hier eingeben

\documentclass[a4paper,11pt]{article}
\usepackage{tikz}
\usepackage{subfigure}
\usepackage{array}

\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{forest}
\begin{document}
\begin{figure}[htbp]
\begin{tabular}{C{.48\textwidth}C{.48\textwidth}}
\subfigure [Subfigure 1] {
\resizebox{0.4\textwidth}{!}{%
\begin{forest}
for tree={delay={where content={}{content={\phantom{00}}}{}},s sep+=5mm,l+=5mm}
[,circle,fill=black,inner sep=1mm
  [,circle,fill=red,inner sep=0.5mm
        [,circle,draw,red,inner sep=0.25mm,edge={red}
        [,circle,draw,red,inner sep=0.25mm,edge={red}]
     ]
     [,circle,draw,red,inner sep=0.5mm
        [,circle,draw,red,inner sep=0.25mm,edge={red}]
     ] 
  ]
  [,circle,fill=blue,inner sep=0.5mm
     [,circle,draw,blue,inner sep=0.25mm,edge={blue}
     ] 
  ]
  [,circle,fill=green,inner sep=0.5mm]
  [,circle,fill=orange,inner sep=0.5mm
  ]
]
\end{forest}
}}&
\subfigure [Subfigure 2] {
    \resizebox{0.4\textwidth}{!}{%
\begin{forest}
for tree={delay={where content={}{content={\phantom{00}}}{}},s sep+=5mm,l+=5mm}
[,circle,fill=black,inner sep=1mm
  [,circle,fill=red,inner sep=0.5mm
     [,circle,draw,red,inner sep=0.25mm,edge={red}]
     [,circle,draw,red,inner sep=0.5mm 
     ] 
  ]
  [,circle,fill=blue,inner sep=0.5mm
     [,circle,draw,blue,inner sep=0.25mm,edge={blue}
        [,circle,draw,blue,inner sep=0.25mm,edge={blue}]
     ]
     [,circle,draw,blue,inner sep=0.25mm,edge={blue}
     ] 
  ]
  [,circle,fill=green,inner sep=0.5mm  
  ]
  [,circle,fill=orange,inner sep=0.5mm
  ]
]
\end{forest}
}}\\ % <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< HERE HERE HERE
\subfigure [Subfigure 3]{
    \resizebox{0.4\textwidth}{!}{%
\begin{forest}
for tree={delay={where content={}{content={\phantom{00}}}{}},s sep+=5mm,l+=5mm}
[,circle,fill=black,inner sep=1mm
  [,circle,fill=red,inner sep=0.5mm]
  [,circle,fill=blue,inner sep=0.5mm]
  [,circle,fill=green,inner sep=0.5mm
        [,circle,draw,green,inner sep=0.25mm,edge={green}]
  ]
  [,circle,fill=orange,inner sep=0.5mm
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}]
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}
            [,circle,draw,orange,inner sep=0.25mm,edge={orange}]    
        ] 
  ]
]
\end{forest}
}}& % <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< HERE HERE HERE
\subfigure [Subfigure 4] {
    \resizebox{0.4\textwidth}{!}{%
\begin{forest}
for tree={delay={where content={}{content={\phantom{00}}}{}},s sep+=5mm,l+=5mm}
[,circle,fill=black,inner sep=1mm
  [,circle,fill=red,inner sep=0.5mm]
  [,circle,fill=blue,inner sep=0.5mm]
  [,circle,fill=green,inner sep=0.5mm
        [,circle,draw,green,inner sep=0.25mm,edge={green}]
        [,circle,draw,green,inner sep=0.25mm,edge={green}]
  ]
  [,circle,fill=orange,inner sep=0.5mm
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}]
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}]
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}
        [,circle,draw,orange,inner sep=0.25mm,edge={orange}
            [,circle,draw,orange,inner sep=0.25mm,edge={orange}]
        ] 
        ] 
  ]
]
\end{forest}
}}
\end{tabular}
\end{figure}
\end{document}

verwandte Informationen