%sample file
%all possible combinations of predefined floatrow styles
%plain environments and float rows
%caption above/below float object
\documentclass{book}

\usepackage[footskip=4pt,objectset=centering]{floatrow}

%load caption
\usepackage[font=small,labelfont=bf,labelsep=period,
   justification=justified,singlelinecheck=no]{caption}[2004/11/28]

\providecommand*{\com}[1]{\texttt{\char`\\#1}}

%%%try with fancy shadowbox frame
%%%there is the trick: base boxed and BOXED styles changed to use shadowbox frame
%\usepackage{fr-fancy}
%\DeclareFloatStyle{boxed}{capposition=bottom,captionskip=2pt,
%  framestyle=shadowbox,heightadjust=object,framearound=object}
%\DeclareFloatStyle{BOXED}{capposition=bottom,framestyle=shadowbox,
%  framefit=yes,heightadjust=all,framearound=all}

\setlength\textfloatsep{8ptplus2ptminus2pt}
\setlength\intextsep{8ptplus2ptminus2pt}
\advance\textheight2in
\advance\topmargin-.75in
\hbadness2000
\advance\textwidth.5in
\advance\evensidemargin-.25in
\advance\oddsidemargin-.25in

\begin{document}
\chapter{Float Boxes with Foots: Variants of Layout}

In this sample file are gathered plain float environments and float rows
with usage of all predefined base float styles. You may try to run this document
with \texttt{shadowbox} frame: uncomment line with \verb|\usepackage{fr-fancy}|
at the preamble and lines below.

The default vertical alignment of float objects is centered.
To change alignment to top edge you may say:
\begin{verbatim}
\floatsetup{valign=t}
\end{verbatim}
like in current sample.
Keys are analogous to option of vertical alignment in minipage and \verb|\parbox|:
\texttt{t}---for top alignment, \texttt{c}---for center alignment,
\texttt{b}---for bottom alignment, and \texttt{s}---to stretch float object material
to full height.

\emph{Note}. All float styles with frames get \verb|frameset={\fboxsep7.5pt}|
to get more visible differences between fitted and non-fitted frames.

%%%aligns float objects by top
\floatsetup{valign=t}

\newcommand\PICTURE[4]{\begin{picture}(#1,#2)
  \put(0,0){\line(#3,#4){#1}}\put(0,0){\line(1,0){#1}}\put(0,0){\line(0,1){#2}}
  \put(0,#2){\line(#3,-#4){#1}}\put(0,#2){\line(1,0){#1}}
  \put(#1,0){\line(0,1){#2}}
  \end{picture}}
\newcommand\FIGS[5][]{
\clearpage
\markboth
{{\small Variant #3: \texttt{style=#2,capposition=#4,footposition=#5}}}
{{\small Variant #3: \texttt{style=#2,capposition=#4,footposition=#5}}}

\noindent Var.\,#3: \protect\com{floatsetup}\texttt{\{style=#2,\allowbreak capposition=#4,\allowbreak
footposition=#5\}}

\clearfloatsetup{figure}
\floatsetup[figure]{style=#2,capposition=#4,footposition=#5#1
%%%you may try to create row with usage of predefined height uncomment next line
%%%and [150] few lines below
%,heightadjust=all
}
\begingroup\samepage
\begin{figure}[H]
  {\PICTURE{20}{20}11}%
  \caption{%
Plain figure in \texttt{#2} style. Caption position \texttt{#4}}%
\label{fig:plain:#3}%
\floatfoot{\sloppy Much more, more and more and more and more and more and more and more text inside macro
\protect\com{floatfoot}}%
\end{figure}

\medskip
\strut\vrule
\medskip

\begin{figure}[H]
\begin{floatrow}[3]
\floatbox{figure}
{\caption{Beside figure in float row, ``column'' width. And more text\protect\footnote{\texttt{footpos=#5}}}}
{\PICTURE{20}{20}11%
\floatfoot{\sloppy Text inside \protect\com{floatfoot}}%
\label{figI:#2:row:#3}}

\floatbox{figure}[\FBwidth]
{\caption{Beside figure, graphic width\strut}\label{figII:#2:row:#3}}
{\PICTURE{96}{48}21%
\floatfoot{\sloppy More and more text inside the \protect\com{floatfoot}}}

%%%you may try to create float rows with usage of predefined height - uncomment [150pt]
%%%and key heightadjust in \floatsetup few lines above
\floatbox{figure}[\Xhsize]%[150pt]
{\caption{Beside figure in float row. Float row in \texttt{#2} style, caption \texttt{#4}}}
{\PICTURE{35}{35}11%
\floatfoot{\sloppy Much more, more and more, more and more text inside \protect\com{floatfoot}}%
\label{figIII:#2:row:#3}}
\end{floatrow}
\end{figure}

\medskip
\strut\vrule
\medskip

\captionof{figure}{Alone caption inside \protect\com{captionof}}

\medskip
\strut\vrule
\medskip

\captionof*{figure}{Alone starred caption inside \protect\com{captionof*}}

\medskip
\strut\vrule
\medskip

\floatbox{figure}{}{\caption{Alone caption inside \protect\com{floatbox}. Float row in \texttt{#2} style, caption \texttt{#4}. The next goes alone graphics inside \protect\com{floatbox}. The last goes row of the alone graphics}}

\medskip
\strut\vrule
\medskip

\floatbox{figure}{\PICTURE{35}{35}11}{}

\medskip
\strut\vrule
\medskip

\begin{figure}[H]
\begin{floatrow}[3]
\floatbox{figure}
{}
{\PICTURE{20}{20}11}

\floatbox{figure}[\FBwidth]
{}
{\PICTURE{96}{48}21}

\floatbox{figure}[\Xhsize]%[150pt]
{}
{\PICTURE{35}{35}11}
\end{floatrow}
\end{figure}

\endgroup}

\clearpage\raggedright
%
\FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{I}{TOP}{caption}
\FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{II}{bottom}{caption}

\FIGS{Ruled}{III}{TOP}{caption}
\FIGS{Ruled}{IV}{bottom}{caption}

\FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{V}{TOP}{caption}
\FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{VI}{bottom}{caption}

%
\FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{VII}{TOP}{default}
\FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{VIII}{bottom}{default}

\FIGS{Ruled}{IX}{TOP}{default}
\FIGS{Ruled}{X}{bottom}{default}

\FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{XI}{TOP}{default}
\FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{XII}{bottom}{default}

%
\FIGS[,frameset={\fboxsep7.5pt}]{BOXED}{XIII}{TOP}{bottom}
\FIGS{Ruled}{XIV}{TOP}{bottom}

\FIGS[,frameset={\fboxsep7.5pt}]{Boxed}{XV}{TOP}{bottom}

\clearpage
\textbf{The next variants (XVI--XXI) show layout of framed styles
with key \texttt{framefit=no}; \texttt{boxed} style (native style of \textsf{float} package),
and \texttt{BOXED} with added key \texttt{framefit=no}.}
\vfill\vbox{}\vfill

\floatsetup{floatrowsep=qquad}
\clearpage
\FIGS[,frameset={\fboxsep7.5pt}]{boxed}{XVI}{TOP}{caption}
\FIGS[,framefit=no,frameset={\fboxsep7.5pt}]{BOXED}{XVII}{TOP}{caption}

\FIGS[,frameset={\fboxsep7.5pt}]{boxed}{XVIII}{TOP}{default}
\FIGS[,framefit=no,frameset={\fboxsep7.5pt}]{BOXED}{XIX}{TOP}{default}

\FIGS[,frameset={\fboxsep7.5pt}]{boxed}{XX}{TOP}{bottom}
\FIGS[,framefit=no,frameset={\fboxsep7.5pt}]{BOXED}{XXI}{TOP}{bottom}

\FIGS{plain}{XXII}{TOP}{caption}
\FIGS{plain}{XXIII}{bottom}{caption}

\FIGS{plain}{XXIV}{TOP}{default}
\FIGS{plain}{XXV}{bottom}{default}

\FIGS{plain}{XXVI}{TOP}{bottom}

\end{document} 