I want to use the subfig package to have a neat row of figures with captions for each one of them. However, as soon as I add the line \usepackage{subfig}, pdfLaTeX fails with the following error:

! Undefined control sequence.
<argument> \sf@counterlist 

l.54 \begin{document}

I have commented this line (and the corresponding lines where I am actually using the subfig package) and everything works fine. The preamble is






And here's the part where I am using the subfloats:

\subfloat[2006]{\includegraphics[width=.24\textwidth, height=.24\textwidth, frame]{figures/2006-cloud-crop.pdf}} &
\subfloat[2007]{\includegraphics[width=.24\textwidth, height=.24\textwidth, frame]{figures/2007-cloud-crop.pdf}} &
\subfloat[2008]{\includegraphics[width=.24\textwidth, height=.24\textwidth, frame]{figures/2008-cloud-crop.pdf}} &
\subfloat[2009]{\includegraphics[width=.24\textwidth, height=.24\textwidth, frame]{figures/2009-cloud-crop.pdf}} \\
\subfloat[2010]{\includegraphics[width=.24\textwidth, height=.24\textwidth, frame]{figures/2010-cloud-crop.pdf}} &
\subfloat[2011]{\includegraphics[width=.24\textwidth, height=.24\textwidth, frame]{figures/2011-cloud-crop.pdf}} &
\subfloat[2012]{\includegraphics[width=.24\textwidth, height=.24\textwidth, frame]{figures/2012-cloud-crop.pdf}} &
\subfloat[2013]{\includegraphics[width=.24\textwidth, height=.24\textwidth, frame]{figures/2013-cloud-crop.pdf}} \\

Is this error thrown due to some package incompatibility? I am a little taken aback by the error being thrown right after the preamble.

  • 2
    You have to choose between subfigure or subfig, but not both. Try without the former. – Werner Apr 9 '14 at 16:59
  • That worked! I was using subfigure before, but upon learning that it's obsolete, I switched to subfig. Is there a central list/repository for LaTeX where the package incompatibilities are mentioned? Also ... please post your comment as an answer so that I can accept it. – Chthonic Project Apr 9 '14 at 17:06
  • 1

subfigure is considered obsolete by the package author:

The pack­age is now con­sid­ered ob­so­lete: it was su­per­seded by sub­fig, but users may find the more re­cent sub­cap­tion pack­age more sat­is­fac­tory.

Remove it from your preamble and use subfig only.

| improve this answer | |
  • Also for me has worked the solution above. The problem is that the packages subfigure and subfloat are in conflict with each other. So we need to enable the subfig package and disable the subfigure one. – GrazMand01 Dec 29 '17 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.