Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
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

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.