I am trying to have subfigures within one figure lets say Figure 1 , below is the code I have now. The problem is it doesn't show after I compile the tex and under the figures the following caption Fig1a:fishfigure and Fig1a:catfigure it shows instead: the following (a)fishfigure (b)catfigure…
Does anyone know what the problem is?
\begin{figure}
\centering
\subfigure[fish figure]{%
\includegraphics[width=0.45\textwidth]{fish}%
\label{fig:fish}%
}
\hfil
\subfigure
[cat figure]{%
\includegraphics[width=0.45\textwidth]{cat}%
\label{fig:cat}%
}
\hfil
\subfigure
[dogfigure]{%
\includegraphics[width=0.45\textwidth]{dog}%
\label{fig:dog}%
}
\end{figure}
Best Answer
Use the
subcaption
package instead of the obsoletesubfigure
, redefine\thesubfigure
and declare the desired format for the label using\DeclareCaptionLabelFormat
:A little example, using
\subcaptionbox
(another options would be to use thesubfigure
environment fromsubcaption
):The
demo
option forgraphicx
simply replaces actual figures with black rectangles; do not use that option in your actual document.