\subfigure{} で複数の森林ツリーを配置する

\subfigure{} で複数の森林ツリーを配置する

木を 2 x 2 に配置したいのですが、代わりに次のようになります:

ここに画像の説明を入力してください

何が間違っているのでしょうか? エラーが見つかりません。

\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}

答え1

コード内で、二重のバックスラッシュ\\と 2 番目のバック&スラッシュが欠落しています。(以下のコードでマークされた位置を参照してください。)

ここに画像の説明を入力してください

\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}

関連情報