2

I am writing a paper using LaTeX, and using a subfig package to arrange images. My problem is that the main caption is wrapped when I use 2 x 3 images with subfloat which occupies 2 columns. I have also tried to use \captionsetup to set width, format.... but it does not work.

The code is:

\begin{figure}[t]   
\subfloat[8 images]{{\includegraphics[width=5.5cm]{screenshots/Comparison/8_jump} }}%
\subfloat[16 images]{{\includegraphics[width=5.5cm]{screenshots/Comparison/16_jump} }}%    
\subfloat[32 images]{{\includegraphics[width=5.5cm]{screenshots/Comparison/32_jump} }}%
\hfill    
\subfloat[8 times]{{\includegraphics[width=5.5cm]{screenshots/Comparison/8_ours_jump} }}%
\subfloat[16 times]{{\includegraphics[width=5.5cm]{screenshots/Comparison/16_ours_jump} }}%    
\subfloat[32 times]{{\includegraphics[width=5.5cm]{screenshots/Comparison/32_ours_jump} }}% 

\caption{AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA long caption which occupies two column, but it is wrapped into one column.}%

\label{fig:Comparison}%
\end{figure}

How do I input a main caption that occupies two column?

1
  • Welcome to TeX.SE. There seems to be some important information that is hinted at in your posting, but not made explicit. E.g., is your document set in two-column mode? In addition, please let us know which document class you use, what the paper size is, and what the size of the (two-column or single-column) text block is. In case the document is in two-column mode, have you tried using a figure* environment instead of a figure environment?
    – Mico
    Aug 30, 2015 at 13:25

1 Answer 1

1

I infer from your write-up (though it's not made explicit) that your document uses a two-column format. Moreover, you're looking to generate a figure that spans both text columns. If that's the case, you should use a figure* environment instead of a figure environment; the former is set up to span both columns, and its caption will thus also be able to span the entire width of the figure.

I would also like to suggest you not set absolute widths for the subfigures; instead, use relative widths. Doing so will make it more straightforward to fill up the available space efficiently, without a lot of trial-and-error runs.

The thin lines around three sides of the following screenshot are inserted by the showframe package; they're there merely to illustrate the edges of the text block.

enter image description here

\documentclass[twocolumn]{article}
\usepackage{subfig}         % for "\subfloat" macros
\usepackage[demo]{graphicx} % remove "demo" option in your real document
\usepackage{showframe}      % just to illustrate borders of text block
\usepackage{lipsum}         % package that provides filler text

\begin{document}
\lipsum[1-2] % filler text

\begin{figure*}[t!]
\subfloat[8 images]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/8_jump}}\hspace*{\fill}
\subfloat[16 images]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/16_jump}}\hspace*{\fill}
\subfloat[32 images]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/32_jump}}

\subfloat[8 times]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/8_ours_jump}}\hspace*{\fill}
\subfloat[16 times]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/16_ours_jump}}\hspace*{\fill}   
\subfloat[32 times]{\includegraphics[width=0.32\textwidth]{screenshots/Comparison/32_ours_jump}} 

\caption{Six subfigures with a very long caption which now occupies both columns. Observe that the caption is no longer confined to the first, i.e., left-hand, column.}

\label{fig:Comparison}
\end{figure*}

\lipsum[3-9] % more filler text
\end{document}
1
  • @minpu - You're welcome! Feel free to upvote and/or "accept" (by clicking on the check-mark symbol) the answer. ;-)
    – Mico
    Aug 30, 2015 at 15:59

You must log in to answer this question.

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