0

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!

2

2 Answers 2

4

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.

4
  • tx for answering. I am trying your solution but error is occurring about subfloat. I have the \usepackage{graphicx} \usepackage{subfigure} \usepackage{subfloat}.
    – doxsi
    Commented Jun 21, 2012 at 8:18
  • I added my header to the example. It is possible that subfigure and subfloat don't play nice together.
    – Laura
    Commented Jun 21, 2012 at 9:49
  • 1
    @doxsi The only package to use in your case is subfig, in my opinion; subfigure is obsolete and you're using only its syntax.
    – egreg
    Commented Jun 21, 2012 at 17:28
  • Tx , it works. I just edited because "]" miss in the code
    – doxsi
    Commented Jun 22, 2012 at 12:48
0

A solution using subfig and floatrow with global caption

\documentclass{article}
\usepackage{subfig} %must be loaded before floatrow, since i loads caption
\usepackage{floatrow}
\usepackage{graphicx}
\begin{document}

\begin{figure}
\ffigbox[\FBwidth]{%
\begin{subfloatrow}
\includegraphics{img1-a}\quad
\includegraphics{img1-b}
\end{subfloatrow}

\begin{subfloatrow}
\ffigbox[\FBwidth]{\caption{}\label{subfig:a}\includegraphics{img2-a}}{}
\ffigbox[\FBwidth]{\caption{}\label{subfig:b}\includegraphics{img2-b}}{}
\end{subfloatrow}
\vspace{10pt}
\begin{subfloatrow}
\includegraphics{img1-c}\quad
\includegraphics{img1-d}
\end{subfloatrow}

\begin{subfloatrow}
\ffigbox[\FBwidth]{\caption{}\label{subfig:c}\includegraphics{img2-c}}{}
\ffigbox[\FBwidth]{\caption{}\label{subfig:d}\includegraphics{img2-d}}{}
\end{subfloatrow}}
{\caption{now with caption}\label{fig:figures}}
\end{figure}

\end{document}
2
  • Tx, it works (erasing subfigure package). But I am esperimenting that no global caption appear using your solution.
    – doxsi
    Commented Jun 22, 2012 at 10:57
  • I noticed that too and wondered why, but since your sketch didn't had one either I stopped wondering why Commented Jun 22, 2012 at 14:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .