# Incompatibility problem of the packages subfig and subcaption [duplicate]

This question already has an answer here:

I want have three subfigures in a special order. One on the right, two on the left. Therefor I found a snippet here on StackExchange. Alone the snippet works fine, you can check this by comment out the first figure-enviroment.

The problem is, that I have a lot of subfloats in my document and the packages subfig and subcaption are incompatible.

Is there a way to use normal subfloats and also get the 3-subfigure-example running?

Best, TomBoo!

minimal example:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption,subcaption}
\usepackage{subfig}

\begin{document}

\begin{figure}[htb]
\centering
\subfloat[test figure one \label{fig:1:test1}] {\includegraphics[width=0.30\textwidth]{image1}}
\subfloat[test figure two \label{fig:1:test2}] {\includegraphics[width=0.30\textwidth]{image1}}
\caption{test figures}
\label{fig:1:tests}
\end{figure}

\begin{figure}
\begin{minipage}[c][11cm][t]{.5\textwidth}
\vspace*{\fill}
\centering
\includegraphics[width=5cm,height=10cm]{image1}
\subcaption{test figure one}
\label{fig:2:test1}
\end{minipage}%
\begin{minipage}[c][11cm][t]{.5\textwidth}
\vspace*{\fill}
\centering
\includegraphics[width=5cm,height=4.5cm]{image1}
\subcaption{test figure two}
\label{fig:2:test2}\par\vfill
\includegraphics[width=5cm,height=4.5cm]{image1}
\subcaption{test figure three}
\label{fig:3:test3}
\end{minipage}
\caption{another test figures}
\label{fig:2:tests}
\end{figure}

\end{document}


## marked as duplicate by egreg, Werner, mafp, Martin Schröder, KurtAug 8 '13 at 1:23

• Welcome to TeX.SX! I have added a subfig based solution to the other question because it's better not having information scattered through different questions. If that new solution is good for you, please let us know so we can close this one as duplicate. Don't worry about this: this was indeed a good question. – egreg Aug 6 '13 at 16:54
• The solution works perfectly fine! So can be closed. – TomBoo Aug 7 '13 at 22:09

Since you say you are already using subfig extensive, I am assuming it would be a hassle to change all the \subfloats. Therefore, you can use the capt-of package and set the \captionsetup.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\captionsetup[subfigure]{labelformat=parens,labelsep=space,font=small}
\usepackage{subfig}

\begin{document}

\begin{figure}[htb]
\centering
\subfloat[test figure one \label{fig:1:test1}] {\includegraphics[width=0.30\textwidth]{image1}}
\subfloat[test figure two \label{fig:1:test2}] {\includegraphics[width=0.30\textwidth]{image1}}
\caption{test figures}
\label{fig:1:tests}
\end{figure}

\begin{figure}
\begin{minipage}[c][11cm][t]{.5\textwidth}
\vspace*{\fill}
\centering
\includegraphics[width=5cm,height=10cm]{image1}
\captionof{subfigure}{test figure one}
\label{fig:2:test1}
\end{minipage}%
\begin{minipage}[c][11cm][t]{.5\textwidth}
\vspace*{\fill}
\centering
\includegraphics[width=5cm,height=4.5cm]{image1}
\captionof{subfigure}{test figure two}
\label{fig:2:test2}\par\vfill
\includegraphics[width=5cm,height=4.5cm]{image1}
\captionof{subfigure}{test figure three}
\label{fig:3:test3}
\end{minipage}
\caption{another test figures}
\label{fig:2:tests}
\end{figure}

\end{document}


I need to figure out what I set to remove the : so I will update when I find it. With Gonzalo Medina's suggestion, we can achieve the look of subfigures by having this line of code: \captionsetup[subfigure]{labelformat=parens,labelsep=space,font=small}