[Tex/LaTex] subfloatrow of package floatrow does not work without subcaptions

floatrow

I have two pictures that I want to place as subparts using the floatrow package.
The following example works if I add subcaptions to the parts, but does not if I leave them out.

I do not want any subcaptions for these parts.
Am I doing something wrong or is this a bug?

Here is a minimal working example:

\documentclass{article}

\usepackage[demo]{graphicx}
\usepackage{caption,subcaption}
\usepackage{floatrow}

\begin{document}

    \begin{figure}
      \ffigbox{%
        \begin{subfloatrow}[2]%
          \ffigbox{%
            \includegraphics[width=3cm,height=3cm]{fig1}%
          }{
            %\subcaption{} %% does not work without
          }%
          \ffigbox{%
            \includegraphics[width=3cm,height=3cm]{fig2}%
          }{
            %\subcaption{} %% does not work without
          }%
        \end{subfloatrow}% 
      }{
        \caption{A caption}
      }
    \end{figure}

\end{document}

Best Answer

You can use the \phantomcaption command to actually skip the caption of the subfigures.

\documentclass{article}

\usepackage[demo]{graphicx}
\usepackage{subcaption}


\begin{document}

\begin{figure}

\begin{subfigure}{0.5\textwidth}\centering
\includegraphics[width=3cm,height=3cm]{fig1}%
\phantomcaption
\label{fig:subfiga}
\end{subfigure}

\begin{subfigure}{0.5\textwidth}\centering
\includegraphics[width=3cm,height=3cm]{fig1}%
\phantomcaption
\label{fig:subfigb}
\end{subfigure}

\caption{A caption}
\label{fig:thefig}
\end{figure}

\end{document}

enter image description here