2

This question already has an answer here:

When trying to compile my report, I receive an error related to the subcaption package (which I load in my preamble):

! Package subcaption Error: This package can't be used in cooperation (subcaption) with the subfig package.

After some research, I found that the subcaption and subfig packages cannot be used at the same time. The problem is that I don't load subfig explicitly anywhere in my preamble. It must get loaded somehow, but I don't know where in my input file. How can I find that out?

marked as duplicate by jub0bs, egreg, Werner, Peter Jansson, mafp Nov 27 '13 at 22:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • The log files lists which files are loaded. – Andrew Swann Nov 27 '13 at 13:12
  • The log file does not show that any file containing the string subfig is loaded. – Kent Munthe Caspersen Nov 27 '13 at 13:16
  • 3
    Do you have some sort of template file? It is most likely, that subfig is loaded there. You can use the approach to prepare Minimal working examples to find the cause. – Johannes_B Nov 27 '13 at 13:34
  • 2
    If you're not explicitly loading subfig in your input document, it may still be required (unbeknownst to you) in the class file and/or in one of the packages you load. Strategy? Divide & conquer: place the following code before \documentclass in your input file: \makeatletter \newcommand\CheckIfSubfigLoaded{\@ifpackageloaded{subfig}{\@latex@warning{The subfig package has been loaded}}{}} \makeatother. Then call the \CheckIfSubfigLoaded somewhere in your preamble. If you get my warning, it means the package has been already been loaded. That way you can locate where subfig is called . – jub0bs Nov 27 '13 at 21:32
  • @Jubobs that was what I was looking for, thank you. – Kent Munthe Caspersen Nov 27 '13 at 21:40