6

this problem is similar to others but I cannot find a solution.

In the example below I have a figure with 6 subfigures. I would like to remove the label/numbering from the 2nd, 4th and 6th subfigure, but I would like the remaining labels to read (a), (b) and (c).

At the moment the compiled figure has labels (a), (c) and (e)... i.e. it doesn't print (b), (d) or (f), but still thinks they are there. Is there a simple solution to this?

\begin{figure}
\begin{center}
    \subfigure[]{\includegraphics{image.pdf}}    % label/numbering
    \subfigure{\includegraphics{image.pdf}}      % no label/numbering
    \subfigure[]{\includegraphics{image.pdf}}    % label/numbering
    \subfigure{\includegraphics{image.pdf}}      % no label/numbering
    \subfigure[]{\includegraphics{image.pdf}}    % label/numbering
    \subfigure{\includegraphics{image.pdf}}      % no label/numbering
\end{center}
\caption[Short caption.] {\label{fig:figure_label} Long caption.}
\end{figure}
  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Henri Menke Apr 6 '14 at 17:53
7

You can use

    \addtocounter{subfigure}{-1}

as demonstrated in the following MWE:

% arara: pdflatex
\documentclass{article}
\usepackage{subfig}
\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}
  \centering
    \subfloat[]{\includegraphics{image}}    % label/numbering
    \subfloat{\includegraphics{image}}      % no label/numbering
    \\
    \addtocounter{subfigure}{-1}
    \subfloat[]{\includegraphics{image}}    % label/numbering
    \subfloat{\includegraphics{image}}      % no label/numbering
    \\
    \addtocounter{subfigure}{-1}
    \subfloat[]{\includegraphics{image}}    % label/numbering
    \subfloat{\includegraphics{image}}      % no label/numbering
\caption[Short caption.] {\label{fig:figure_label} Long caption.}
\end{figure}

\end{document}

Note that subfigure is obsolete, and you should use either subfig or subcaption instead; see What is the difference between \subfigure and \subfloat?, for example.

2

Instead of the deprecated subfigure package, you may want to use the subcaption package and its subfigure environment. Specifically, you could use subcaption environments for those images you wish to give a caption and label to, and minipage environments for the remaining images, i.e., the one which needn't or shouldn't get captions and labels.

enter image description here

\documentclass{article}
\usepackage{subcaption}
\usepackage[demo]{graphicx} % remove 'demo' for real document

\begin{document}
\begin{figure}[ht!]
\begin{subfigure}[t]{0.48\textwidth}
\includegraphics[width=\linewidth]{image.pdf}
\caption{First labeled subfigure} \label{fig:1a}
\end{subfigure}
\hspace*{\fill}
\begin{minipage}[t]{0.48\textwidth}
\includegraphics[width=\linewidth]{image.pdf}
\end{minipage}

\medskip
\begin{subfigure}[t]{0.48\textwidth}
\includegraphics[width=\linewidth]{image.pdf}
\caption{Second labelled subfigure} \label{fig:1b}
\end{subfigure}
\hspace*{\fill}
\begin{minipage}[t]{0.48\textwidth}
\includegraphics[width=\linewidth]{image.pdf}
\end{minipage}

\medskip
\begin{subfigure}[t]{0.48\textwidth}
\includegraphics[width=\linewidth]{image.pdf}
\caption{Third labelled subfigure} \label{fig:1c}
\end{subfigure}
\hspace*{\fill}
\begin{minipage}[t]{0.48\textwidth}
\includegraphics[width=\linewidth]{image.pdf}
\end{minipage}
\caption[Short caption] {Long caption.}
\label{fig:figure_label} 
\end{figure}

Here's a cross-reference to Figure \ref{fig:1b}.
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.