I'm trying to get a caption to span the figure width on a wrapfig environment. But for some reasons it just won't go. Here is my code and a graphical representation:

\begin{wrapfigure}{R}{0.3\textwidth}
\vspace{-30pt}
\label{fig:UbiContentClass}
\ffigbox[\textwidth]
{
\caption{A classe que define Conteúdo Ubíquo}
}
{
\includegraphics[width=\textwidth]{figs/UbiContentClass.png}
}
\vspace{-20pt}
\end{wrapfigure}


\includegraphics[width=\textwidth]{...}into\rule{\textwidth}{...}and include at leastfloatrowandwrapfig. Don't use theminimaldocument class, butarticlerather. – Werner Apr 13 '12 at 02:50\begin{document}
\begin{figure} \ffigbox[\FBwidth] { \caption{caption text caption text caption text caption text caption text caption text caption text caption text caption text caption text caption text caption text }\label{...} } { %\includegraphics[width=.4\linewidth]{dummy} \rule{.4\linewidth]{dummy} } \end{figure}
\end{document}
– David Doria Feb 03 '14 at 18:05figs/UbiContentClass.png. An alternative would be to use image from themwepackage so that everyone can replicate the problem without having to worry about missing images.\rule{<width>}{<height>}is how you should use it to create a black box of width<width>and height<height>. If you\usepackage[demo]{graphicx}, then all images will appear in 100mmx150mm black boxes, but that may not be the size of the original graphic. – Werner Feb 04 '14 at 16:59