Is there a way to use the svg package when the subcaption package is included as well? The svg package uses the subfig package, which apparently leads to conflict. But it seems to be common sense that the subcaption package is prefered over the subfig package.

4 Answers 4


In this answer the solution is to suppress the load of the subfig package by this

\expandafter\def\csname [email protected]\endcsname{}

command. Unfortunately, this works for me only until TeX Live 2015.


I sent an email to the current maintainer of the svg package, and he replied with the following solution:


Works like charm on MiKTeX on windows, I haven't tried another OS or TeX distribution. A new version of the svg package is likely to be released very soon, in which this issue will be fixed.

  • This works for me with TeX Live 2016/Debian. Thank you.
    – Roos
    Nov 11, 2016 at 9:17

Extremely crude workaround:

Copy the svg.sty file to your project folder and simply comment out or remove the following line (line #40):


So far, this doesn't produce any errors and correctly compiles svg files. Also works when I \includesvg the svg image files inside a subcaption environment.


After about 1 hour of work around I found the solution in the official documentation

Package subcaption : https://mirror.hmc.edu/ctan/macros/latex/contrib/caption/subcaption.pdf

Please note: This package is incompatible with the subfigure and subfig packages.

The following latex code for subfigures. But before that you need to include


        \subcaption{A subfigure}\label{fig:1a}
        \subcaption{Another subfigure}\label{fig:1b}
    \caption{A figure}\label{fig:1}

If you happened to include some package like the following


All you need is to comment the above; subfigure and subfig are not compatible with subcaption. Removing them will solve your problem.

  • Can you add a complete answer which shown as have you solved the problem?
    – Sebastiano
    Feb 22, 2019 at 8:13
  • @Sebastiano, the problem is that you cannot have subcaption package together with subfigure and subfig . If you want to use subcaption package, you need to remove the other two. This will solve the problem. Feb 22, 2019 at 8:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .