I'm having some problems when I use the subfig package with the options of float package. The MWE is:
Code: Select all
\documentclass{report}
\usepackage[svgnames]{xcolor}
\usepackage{float}
\usepackage{subfig}
\makeatletter
\renewcommand\floatc@ruled[2]%
{\setbox\@tempboxa\hbox{#2}%
\ifdim\wd\@tempboxa>\hsize #2\par%
\else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
\renewcommand\fs@ruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled%
\def\@fs@pre{\vspace*{0pt}\hrulefill\lower.8ex
\hbox{\colorbox{MidnightBlue}{%
\textcolor{white}{\scriptsize GR\'AFICO\ \thefigure}}}%
\hrulefill\vspace{10pt}}%
\def\@fs@post{\vspace{3pt}\kern2pt\hrule\relax}%
\def\@fs@mid{\addvspace{10pt}}
\let\@fs@iftopcapt\iftrue}
\makeatother
\floatstyle{ruled}
\restylefloat{figure}
\begin{document}
\begin{figure}[!ht]
\centering
\rule{4cm}{2cm}
\caption{A test figure}
\label{fig:test}
\end{figure}
aaa
\begin{figure}[!ht]
\caption{Test Subfigures}
\centering
\subfloat[aaa]{
\centering
\rule{4cm}{2cm}
}
\subfloat[bbb]{
\centering
\rule{4cm}{2cm}
}
\end{figure}
\end{document}
Bests