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.
subfigure
is an obsolete package which shouldn't be used anynore. In its stead you can use subfig
or subcaption
. Below, I used the former, since subcaption
will produce a warning about revtex4-1
being unsupported by caption
(this might not be an issue, but I am not sure):
Notice the line
\captionsetup[subfigure]{labelformat=brace}
so the caption number will have only one parenthesis (instead of the default formatting enclosing the number inside parentheses).
\documentclass[10pt,prl,aps,showpacs,twocolumn,unsortedaddress]{revtex4-1}
\usepackage[caption=false]{subfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{commath}
\usepackage{graphicx,bm}
\usepackage{verbatim}
\captionsetup[subfigure]{labelformat=brace}
\begin{document}
\begin{figure*}
\subfloat[text for the first subfigure\label{sfig:testa}]{%
\includegraphics[height=3cm,width=.49\linewidth]{example-image-a}%
}\hfill
\subfloat[text for the second subfigure\label{sfig:testa}]{%
\includegraphics[height=3cm,width=.49\linewidth]{example-image-b}%
}
\caption{}
\label{}
\end{figure*}
\end{document}
With subcaption
, the code would be:
\documentclass[10pt,prl,aps,showpacs,twocolumn,unsortedaddress]{revtex4-1}
\usepackage{subcaption}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{commath}
\usepackage{graphicx,bm}
\usepackage{verbatim}
\captionsetup[subfigure]{labelformat=brace}
\begin{document}
\begin{figure*}
\begin{subfigure}{0.49\linewidth}
\centering
\includegraphics[height=3cm,width=\linewidth]{example-image-a}
\caption{text for the first subfigure}
\label{sfig:testa}
\end{subfigure}\hfill
\begin{subfigure}{0.49\linewidth}
\centering
\includegraphics[height=3cm,width=\linewidth]{example-image-b}
\caption{test for the second subfigure}
\label{sfig:testb}
\end{subfigure}\hfill
\caption{}
\label{}
\end{figure*}
\end{document}
But, as I mentioned before, you'll receive a warning:
Package caption Warning: Unsupported document class (or package)
detected, usage of the caption package is not recommended.See the
caption package documentation for explanation.
Best Answer
Use
\columnwidth
when specifying how wide you want the figure to be, and\textwidth
for how wide you want your images to be within that subfigure. So\columnwidth
tells you you much of the width of the column you wish your figure to take up (say .45), and then within the subfigure, you want your image to take up the whole of the width of the subfigure. This is measured by any of\textwidth
,\linewidth
,\columnwidth
, or\hsize
. So the width can be set by saywidth=\textwidth
. Using the packagesubcaption
(notsubfigure
), the following should give you the output you need:This should give output similar to: