I am using the subcaption
package and write a caption for each of my subfigures. In order to get a reference to "Fig. 1a", I also have to write a "big caption" below all subfigures. But I don't want to write this "big caption" always. Anyway, I want my figure to have the label "Fig. 1a".
Example:
\documentclass[a4paper]{article}
\usepackage{mwe}
\usepackage{subcaption}
\begin{document}
\begin{figure}[tbp]
\begin{subfigure}[t]{0.48\linewidth}
\includegraphics[width=1\textwidth]{example-image-a}
\caption{An Elephant.}
\label{fig:elephant}
\end{subfigure}
\begin{subfigure}[t]{0.48\linewidth}
\includegraphics[width=1\textwidth]{example-image-b}
\caption{A Mouse.}
\label{fig:mouse}
\end{subfigure}
\caption{"Big caption". How can I avoid this one and get the label "Fig. 1a"?}
\end{figure}
\end{document}
(My question is not about the format of the number (e.g. "1a" or "1.a") but about "how do I get the "1" in my "1a"-reference)
Best Answer
Here is one way of producing the desired output; there may be better ways.
Wherever you want that numbering system for
subfigure
s within afigure
that lacks a\caption
, use, at the beginning of thefigure
environment in question, the\nocaption
command defined in my code below.See section 6 of the
subcaption
manual for more details.