# Is there an incompatibility between caption and picinpar packages?

In the code below, the number of the second figure is 3 instead of 2. It seems that there is an incompatibility between caption and picinpar packages. Unfortunately, the picinpar documentation is not in English so I can't check it out.

\documentclass{article}
\usepackage{picinpar,lipsum}
\usepackage[bf]{caption}
\begin{document}
\begin{figure}[!ht]
\caption{The first caption}
\end{figure}
\begin{figwindow}[1,r,%
\rule{4cm}{2cm},%
{The second caption with a wrong number!}\label{picinpar}]
\lipsum[1]

In Fig.~\ref{picinpar} ...
\end{figwindow}
\end{document}


I know that putting \addtocounter{figure}{...}‎ before and after the second figure, solves the problem, but I want to learn the right way to do this. Because this trick may be forgotten sometimes. So what is the right solution?

-
I suggest you to use wrapfig instead of picinpar –  Harish Kumar Jan 13 '13 at 22:13
or picins ctan.org/pkg/picinpar –  David Carlisle Jan 13 '13 at 22:14
@DavidCarlisle What do you mean by "or picins ctan.org/pkg/picinpar"? –  Vahid Damanafshan Jan 16 '13 at 21:31
I mean, if you follow that URL to the ctan catalog picinpar page it tells you that picinpar is old and to use picins instead (of course picins is getting old two these days:-) –  David Carlisle Jan 16 '13 at 21:33

Thanks for the bug report. I have opened a ticket at sourceforge:

https://sourceforge.net/p/latex-caption/tickets/3/

Unfortunately this was broken since v3.2 of the caption package.
I finally have found the time to fix it, so the counter should be correct after updating to the upcoming version of the caption package.
I will upload a new version of the caption package bundle as soon as I have fixed Ticket #6, too. Impatient ones can get the current version here: