Graphics, Figures & Tables"empty" captions in subfigures?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
daviddoria
Posts: 60
Joined: Tue Sep 30, 2008 9:24 pm

"empty" captions in subfigures?

Post by daviddoria »

Is there a way to get the caption of a subfigure to simply be it's letter?

For example, if I write a description of each subfigure in the figure's caption like this:

Code: Select all

\begin{figure}[ht!]
\centering
\subfigure{
\includegraphics [width=.3\linewidth]{image1}
\label{fig:sub1}
}
\subfigure{
\includegraphics [width=.3\linewidth]{image2}
\label{fig:sub2}
}
\caption{Thresholded consistency/confidence evaluations. \subref{fig:sub1} This is image1. \subref{fig:sub2} This is image2. }
\end{figure}
The reader no longer knows which image is a, b, etc.
I know you can put captions under each subfigure with

Code: Select all

\subfigure[My Subfigure caption]{
\includegraphics [width=.3\linewidth]{image1}
\label{fig:sub1}
}
but I'd rather it just say (a) under the subfigure.

Any suggestions?

Thanks,

Dave

Recommended reading 2024:

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

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

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

"empty" captions in subfigures?

Post by Juanjo »

You are using the old package subfigure, which has been superseded by subfig. With the latter package, your code becomes:

Code: Select all

\begin{figure}[ht!]
   \centering
   \subfloat[][]{\includegraphics[width=.3\linewidth]{image1}\label{fig:sub1}}
   \qquad
   \subfloat[][]{\includegraphics[width=.3\linewidth]{image2}\label{fig:sub2}}
   \caption{Thresholded consistency/confidence evaluations. 
      \subref{fig:sub1} This is image1. \subref{fig:sub2} This is image2. }
\end{figure}
For the same purpose, you may also use the subcaption package. Anyway, if you simply want (a) and (b) under each image and you don't plan to cite them individually, there are simple solutions which do not require any package:

Code: Select all

\begin{figure}[ht!]
   \centering
   \begin{tabular}{c@{\qquad}c}
      \includegraphics[width=.3\linewidth]{image1} &
      \includegraphics[width=.3\linewidth]{image2} \\
      (a) & (b)
   \end{tabular}
   \caption{Thresholded consistency/confidence evaluations. 
      (a) This is image1. (b) This is image2.}
\end{figure}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
daviddoria
Posts: 60
Joined: Tue Sep 30, 2008 9:24 pm

Re: "empty" captions in subfigures?

Post by daviddoria »

Great, thanks. What is the qquad for? The spacing seems to be fine without it. Also, \subfloat[] rather than \subfloat[][] seems to do the same thing.

Thanks!

Dave
Post Reply