[Tex/LaTex] How to adjust subfigure caption width


I'm trying to put subfigures side by side. I used the following code.


\subfigure[subfig a]{\label{fig:sa}}


\subfigure[subfig b]{\label{fig:sb}}


I am getting the following output

enter image description here

I get error if I try the more usual


This may have something to do with the ICML template I'm working on (here)

How do I adjust the caption width in my working \subfigure syntax?

Best Answer

to have sub figures in line, you shouldn't have empty line between them (unless you wish to create a line break between the subfloasts). additionally consider:

  • \subfigure is defined with deprecated package subfigure. It is superseded by the subfig package, with syntax \subfloat[...][<title>]{....} (see mwe below)
  • with \subfloat the width of caption is equal to width of sub image.
  • use of minipages is superfluous.

enter image description here

\usepackage[demo]{graphicx} % remove 'demo' option in real document

\subfloat[subfigure a]{\label{fig:sa}
\subfloat[subfigure b]{\label{fig:sb}