I made an article and insert several subfigures in that as follows:
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{fig6_1}
\caption{Increase}
\end{subfigure}%
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{fig6_2}
\caption{Increase}
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{fig6_3}
\caption{Increase}
\end{subfigure}
\caption{Round}
\end{figure}
But, when I copy the same code to my thesis file, it turns out errors
Command \subcaption already defined. …ubcaption{\captionsetup{subtype*}\caption}
I compile my file with xelatex
in command prompt, it gives a warning error that
Class memoir Warning: You are using caption package with the memoir class. This may cause unexpected or inconsistent results if you use any of the memoir's captioning facilities.
While compiling, it stops with error
! LaTeX Error: Command \subcaption already defined. Or name \end… illegal, see P.192 of the manual.
But, there is no page 192 in the caption
guide on CTAN. I checked the thesis class file and observed use the of memoir
. What change should I have in my code or class file code to make it functional?
Best Answer
As a document class,
memoir
provides sub-float support out of the box. As such, it may have some compatibility problems with packages (extensions) provided by packages likesubcaption
orcaption
. Hence, the errors/warnings being displayed during compilation.Given your code snippet, here's what a comparable version would look like in
memoir
:\newsubfloat
creates the appropriate interface and output-generating structure for a sub-float environment.\subbottom[<ToC>][<caption>]{<stuff>}
sets a sub-float with a caption at the bottom (a counterpart to\subtop
).