# Correct alignment of five figures

I would like to place five figures in one row. The first four figures shall be placed in a 2x2 grid with half the size of the fifth figure, which shall be placed right to the small figures.

I got this code snippet, but is does not do the job, as the second row of the small figures is basically in the right "column" but on row below the larger figure to the right.

\documentclass[12pt,a4paper,twoside]{article}
\usepackage{subcaption} %to have subfigures available

\begin{document}

\begin{figure}
\centering
\begin{subfigure}[t]{0.48\textwidth}
\begin{subfigure}[t]{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img0.pdf}
\end{subfigure}
\begin{subfigure}[t]{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img1.pdf}
\end{subfigure}
\begin{subfigure}[t]{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img2.pdf}
\end{subfigure}
\begin{subfigure}[t]{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img3.pdf}
\end{subfigure}
\caption{four small figures, each half the size of \ref{fig:large}}
\end{subfigure}
\begin{subfigure}[t]{0.48\textwidth}
\includegraphics[width=\textwidth]{pics/fused_img.pdf}
\caption{one large figure.}
\label{fig:large}
\end{subfigure}
\caption{overall caption}
\end{figure}

\end{document}

I basically understand the output, as the second row of the small figures is literally the second row for the "whole" figure. What do I miss, is there a way to align the five figures nicely in one row?

Simply changing the positioners of the two main-subfigures seems to do the trick for me:

\documentclass[12pt,a4paper,twoside]{article}
\usepackage{subcaption} %to have subfigures available

\begin{document}

\begin{figure}
\centering
\begin{subfigure}[ht]{0.48\textwidth}
\begin{subfigure}[t]{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img0.pdf}
\end{subfigure}
\begin{subfigure}[t]{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img1.pdf}
\end{subfigure}
\begin{subfigure}[t]{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img2.pdf}
\end{subfigure}
\begin{subfigure}[t]{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img3.pdf}
\end{subfigure}
\caption{four small figures, each half the size of \ref{fig:large}}
\end{subfigure}
\begin{subfigure}[ht]{0.48\textwidth}
\includegraphics[width=\textwidth]{pics/fused_img.pdf}
\caption{one large figure.}
\label{fig:large}
\end{subfigure}
\caption{overall caption}
\end{figure}

\end{document}

Alright, I figured it out. Just needed to add a minipage. I don't know if this is some kind of nice solution/hack though. If you know a more latex based solution, please let me know!

\documentclass[12pt,a4paper,twoside]{article}
\usepackage{subcaption} %to have subfigures available

\begin{document}
\begin{figure}[h!]
\centering
\begin{subfigure}[h!]{0.49\textwidth}
\begin{minipage}{\textwidth}
\begin{subfigure}{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img0.pdf}
\end{subfigure}
%
\begin{subfigure}{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img1.pdf}
\end{subfigure}
%
\begin{subfigure}{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img2.pdf}
\end{subfigure}
%
\begin{subfigure}{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/img3.pdf}
\end{subfigure}
\end{minipage}
\caption{}
\end{subfigure}
\hfill
\begin{subfigure}{0.49\textwidth}
\includegraphics[width=\textwidth]{pics/fused_img.pdf}
\caption{}
\end{subfigure}
\end{figure}
\end{document}