[Tex/LaTex] Captions in subfigures and skip subfigures in List of Figures

subfloatstable of contents

I don't know whether the two are related each other but I cannot figure out a way to achieve both. What I try to do is basically

  • Put a custom caption below the figure
  • Subfigures automatically captioned as (a), (b), ….
  • List of figures showing only main figure captions.

The closest I got is the below code but this:

  • Lists subfigures too in the LoF
  • Subfigures are captioned as ((A)), ((B))
  • The references are fine, i.e. Figure 2.1(a)

\usepackage{graphicx}
\usepackage{caption}
\usepackage{subfig}
\usepackage{subfloat}
\usepackage{tabularx} 
\begin{figure}[t]
\begin{center}
\begin{tabular}{ccccc}
\subfloat[]{\label{Fig:Fig21A}\includegraphics[width=0.15\linewidth]{FileA}}
& \subfloat[]{\label{Fig:Fig21B}\includegraphics[width=0.15\linewidth]{FileB}}
& \subfloat[]{\label{Fig:Fig21C}\includegraphics[width=0.15\linewidth]{FileC}}
& \subfloat[]{\label{Fig:Fig21D}\includegraphics[width=0.15\linewidth]{FileD}}
& \subfloat[]{\label{Fig:Fig21E}\includegraphics[width=0.15\linewidth]{FileE}}
\end{tabular}
\caption{Main Caption.}
\label{Fig:MainFigure}
\end{center} 
\end{figure}

Best Answer

Use the more modern package subcaption for this.

% arara: pdflatex
% arara: pdflatex

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}

\begin{document}
\listoffigures
\begin{figure}
    \centering
    \begin{subfigure}[b]{.15\textwidth}\includegraphics[width=\linewidth]{FileA}\caption{}\label{Fig:Fig21A}\end{subfigure}\hfil
    \begin{subfigure}[b]{.15\textwidth}\includegraphics[width=\linewidth]{FileB}\caption{}\label{Fig:Fig21B}\end{subfigure}\hfil
    \begin{subfigure}[b]{.15\textwidth}\includegraphics[width=\linewidth]{FileC}\caption{}\label{Fig:Fig21C}\end{subfigure}\hfil
    \begin{subfigure}[b]{.15\textwidth}\includegraphics[width=\linewidth]{FileD}\caption{}\label{Fig:Fig21D}\end{subfigure}\hfil
    \begin{subfigure}[b]{.15\textwidth}\includegraphics[width=\linewidth]{FileE}\caption{}\label{Fig:Fig21E}\end{subfigure}%
    \caption{Main Caption.}
    \label{Fig:MainFigure}
\end{figure}
\section{Test}
See Figures \ref{Fig:Fig21A}, \ref{Fig:Fig21B}, \ref{Fig:Fig21C}, \ref{Fig:Fig21D}, and \ref{Fig:Fig21E} or just \ref{Fig:MainFigure}!
\end{document}

enter image description here