Document ClassesSubfigure Captions multiple lines into one line?

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Successful
Posts: 5
Joined: Fri Nov 07, 2008 10:54 pm

Subfigure Captions multiple lines into one line?

Post by Successful »

my problem can be seen in the image below in the red boxes. how can i get these captions to be in one line? it looks like the captions are formatted so that they fit in the "width" of the figure. how can i make it so that the captions can "extend" beyond the width of the figure?
Image

i did some simple editing in paint. how can i make the captions look like it is in the image below?

Image
the code i'm using is

Code: Select all

\begin{figure} 
  
  \subfigure[Three pull-down menus \label{guistepa} ]{\includegraphics[scale=0.33]{guistep_a.jpg}}  \; \; \; \; \; \;
  \subfigure[Choose Medium \label{guistepb}]{\includegraphics[scale=0.33]{guistep_b.jpg}}  \; \; \; \; \; \; 
  \subfigure[Choose Material \label{guistepc}]{\includegraphics[scale=0.33]{guistep_c.jpg}}  \; \; \; \; \; \;
  \subfigure[Choose Shape \label{guistepd}]{\includegraphics[scale=0.33]{guistep_d.jpg}} \;  \; \; \; \; \; 
  \subfigure[Select Light Polarization \label{guistepe}]{\includegraphics[scale=0.33]{guistep_e.jpg}} 
  
  \subfigure[Pop-up dialog box of shape parameters \label{guistepf}]{\includegraphics[scale=0.5]{guistep_f1.jpg}}   \quad 
  \subfigure[Sliders to change shape parameters\label{guistepg}]{\includegraphics[scale=0.33]{guistep_f2.jpg}}
  \caption{Pictures of animals}\label{compsteps}
\end{figure}
thanks for the help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Subfigure Captions multiple lines into one line?

Post by localghost »

Instead of using subfigure you should change to subfig. You can put your subfloats into a box of a certain width that automatically centers them.

Code: Select all

\begin{figure}[!ht]
  \centering
  \subfloat[First subfloat with a very long caption that doesn't really make sense but to demonstrate the extension of the width\label{subfig-1:dummy}]{%
    \makebox[8cm]{%
      \rule{4cm}{3cm}
    }
  }
  \hspace{5mm}
  \subfloat[Second subfloat with a long caption to demonstrate the normal width\label{subfig-2:dummy}]{%
    \rule{4cm}{3cm}
  }
  \caption{Dummy figure}\label{fig:dummy}
\end{figure}
Adapt the width of the box to your needs.


Best regards and welcome to the board
Thorsten¹
Post Reply