7

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}
1
  • 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. Apr 6, 2014 at 17:53

2 Answers 2

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}
4
  • How do you do this without using "minipage"? Is there a "\addtocounter{subfigure}{-1}" equivalent for caption/subcaption package? Feb 15, 2020 at 9:56
  • @ThatsRightJack - I'm not sure I understand the gist of your question. A subfigure environment is a minipage environment that's been informed what to do if it encounters a \caption directive. Hence, without using minipage isn't feasible in this setup. If, on the other hand, the use of two environments with different names -- subfigure and minipage -- in a single row bothers your aesthetic sensibilities, simply replace all six instances of {minipage} with {subfigure} and recompile the document. It'll look just the same as it did before.
    – Mico
    Feb 15, 2020 at 10:09
  • 1
    OCD...sorry. Thanks for clarify the equivalence. Feb 15, 2020 at 10:35
  • @ThatsRightJack - No need to say sorry. I was genuinely uncertain as to whether I had understood the purpose of you question.
    – Mico
    Feb 15, 2020 at 10:51

You must log in to answer this question.

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