[Tex/LaTex] Two figures in a subfigure

subfloats

I need to show a total of 8 figures in the same page, combining them in this way:

 img1-a img1-b
 img2-a img2-b
   (a)  (b)

 img1-c img1-d
 img2-c img2-d
   (c)  (d)

I tried subfigure,

\begin{figure*}[tpb]
\centering
\subfigure[]
      {\label{fig:conn}
      \includegraphics[width=0.48\columnwidth,keepaspectratio]{img1-a}
      \includegraphics[width=0.48\columnwidth,keepaspectratio]{img1-a}}\hfill

\subfigure[]
//and so on....

but I do not understand how to combine two figures to stay on the same column (i.e. figure img1-a and img2-a). Maybe forcing the subfigure width? Any help will be appreciated!

Best Answer

You can combine the images that have to be placed in the same column in the same subfigure with a minipage. I can't get this to work in subfigure, for some particular reason. But this code should give you the output you want with the subfig package.

\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}

    \begin{figure}[tpb]
        \centering
        \subfloat[]{
            \begin{minipage}{0.5\linewidth}
                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{1a}

                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{2a}
            \end{minipage}} 
        \subfloat[]{
            \begin{minipage}{0.5\linewidth}
                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{1b}

                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{2b}
            \end{minipage}} 

        \subfloat[]{
            \begin{minipage}{0.5\linewidth}
                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{1c}

                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{1d}
            \end{minipage}}  
        \subfloat[]{
            \begin{minipage}{0.5\linewidth}
                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{2c}

                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{2d}
            \end{minipage}} 
    \end{figure}
\end{document}

Beware of removing whitelines here, as that influences the spacing of the floats.