# Using a floatrow environment outside a figure environment

I use the floatrow package to manage my figures. Sometimes one cannot put figures inside a figure environment (e.g. inside a mdframed environment). Hopefully, the \ffigbox macro works outside the figure environment but it is no more the case when I use it inside a floatrow environment.

Is there a way to fix it?

\documentclass{article}
\usepackage{floatrow}

\begin{document}

\begin{figure}[h]
\ffigbox{Test}{\caption{Test}}
\end{figure}

% Works!
\ffigbox{Test}{\caption{Test}}

\begin{figure}[h]
\begin{floatrow}
\ffigbox{Test}{\caption{Test}}
\ffigbox{Test}{\caption{Test}}
\end{floatrow}
\end{figure}

% This won't work.
\begin{floatrow}
\ffigbox{Test}{\caption{Test}}
\ffigbox{Test}{\caption{Test}}
\end{floatrow}

\end{document}

-
It seems that doing a simple \def\@captype{figure} before the floatrow environment does the job. But I'd like to be sure it has no side effect. – cjorssen Feb 10 '13 at 22:21
The \ffigbox is not the issue here: the floatrow environment 'expects' to be inside a float (try just a blank environment on its own). That said, I think you approach of simply forcing the caption type is the answer: that's more or less what \captof does. – Joseph Wright Sep 8 '13 at 18:39

The floatrow environment is designed to be used within a float: it relies on \@captype begin defined. As such, the error is nothing to do with \ffgigbox. Thus the approach of setting \@captype is probably the best plan here.