[Tex/LaTex] Placing two figures (each having subfigures) next two each other

floatspositioningsubfloats

I would like to place two figures, where each figure has subfigures next to each other.
I tried with minipage, but tex does not like the \subfigure as Not in outer par mode.
Is there any way to place figures with subfigures next to each other?

\begin{figure*}[htbp]


\begin{minipage}[hbt]{0,49\textwidth}

\begin{figure}
\subfigure[Subfigure 1.1]{
\label{fig:subfig1_1}
\includegraphics[scale=0.42]{graphs/sub_1_1.pdf}
}

\subfigure[Sub 1.2] {
\label{fig:subfig1_2}
\includegraphics[scale=0.42]{graphs/sub_1_2.pdf}
}
}
\label{fig:subfigure1} 
\caption{Subfigure 1}
\end{figure}
\end{minipage}




\begin{minipage}[hbt]{0,49\textwidth}
%... as above
\end{minipage}
\end{figure*}

Best Answer

You can't put a floating object inside a minipage, but you can place minipages inside a floating object. I notice that you are using the obsolete subfigure package; you should use subfig or subcaption instead.

Below there are two approaches; the first one using the subfig package, and the other one using the subcaption package:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subfig} % Needs subfig for this example.

\begin{document}

\begin{figure}
\begin{minipage}{.48\textwidth}
\centering
\subfloat[]{\includegraphics[width=.4\linewidth]{fig1}}\quad
\subfloat[]{\includegraphics[width=.4\linewidth]{fig2}}
\caption{First figure with two subfigures}
\label{fig:testa}
\end{minipage}\hfill
\begin{minipage}{.48\textwidth}
\centering
\subfloat[]{\includegraphics[width=.4\linewidth]{fig3}}\quad
\subfloat[]{\includegraphics[width=.4\linewidth]{fig4}}
\caption{Second figure with two subfigures}
\label{fig:testb}
\end{minipage}
\end{figure}

\end{document} 

enter image description here

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}
\begin{minipage}{.48\textwidth}
\centering
\subcaptionbox{}{\includegraphics[width=.4\linewidth]{fig1}}\quad
\subcaptionbox{}{\includegraphics[width=.4\linewidth]{fig2}}
\caption{First figure with two subfigures}
\label{fig:testa}
\end{minipage}\hfill
\begin{minipage}{.48\textwidth}
\centering
\subcaptionbox{}{\includegraphics[width=.4\linewidth]{fig3}}\quad
\subcaptionbox{}{\includegraphics[width=.4\linewidth]{fig4}}
\caption{Second figure with two subfigures}
\label{fig:testb}
\end{minipage}
\end{figure}

\end{document}

enter image description here

The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document.