I just started using a big template for a paper. With this template, if I \usepackage{subfig}
, I get :
Unsupported document class (or package) detected, (caption) usage of the caption package is not recommended
.
After some googling, it looked like I should instead do
\usepackage{subfig}
.
However, when I do that, my figures that use \subfloat
produce Undefined control sequence }
. Any suggestions?
The error is produced with this :
\begin{figure}[H]
\centering
\subfloat[Correct position]{
\fbox{\rule{0pt}{2in} \rule{0.9\linewidth}{0pt}}
\label{fig:CatExperiments:Correct}
}
\caption{Cat sculpture in varying positions.}
\label{fig:CatExperiments}
\end{figure}
but is not produced if I comment that out. After more Googling, it sounds like subfig
is deprecated, and I should use subcaption instead. So I tried
\usepackage{caption}
\usepackage{subcaption}
\begin{figure}[H]
\begin{center}
\fbox{\rule{0pt}{2in} \rule{0.9\linewidth}{0pt}}
\end{center}
\caption{Diagram of consistency function}
\label{fig:ConsistencyFunction}
\end{figure}
but now I get Undefined control sequence \caption
.
Here is a minimal example (note it uses this style:
rpi.edu/dept/arc/docs/latex-thesis/thesis.cls ):
\documentclass[chap]{thesis}
%\usepackage{subfig} % Error: Unsupported document class (or package) detected, (caption) usage of the caption package is not recommended. Fixed by caption=false below:
\usepackage{subfig} % Error: Undefined control sequence }
\begin{document}
\begin{figure}[H]
\centering
\subfloat[Correct position]{
\fbox{\rule{0pt}{2in} \rule{0.9\linewidth}{0pt}}
\label{fig:CatExperiments:Correct}
}
\caption{Cat sculpture in varying positions.}
\label{fig:CatExperiments}
\end{figure}
\end{document}
Any suggestions of what I should do to fix this?
Best Answer
The question has been solved on LaTeX-Community.org, the solution was manually updating the
caption
package bycaption.ins
sudo texhash
at the command prompt.