# Abstraction layer for creation of floating figures with caption

A floating figure or table typically consists of the following parts:

• The floating environment
• The figure itself
• A caption
• Optionally, rules before/after the figure
• Perhaps a "source" statement
• ...

Different layouts have different requirements for, e.g., positioning of captions, typical placement of floats, presence of rules etc.. This makes code reuse difficult. For this reason, we have created an abstraction layer that takes everything the figure consists of as arguments and arranges it so that it matches the requirements of the different layouts.

My question is: Is there already a package that provides this or a similar functionality? If not, would such a package be of general interest, or is the approach flawed in some way?

-
You may look at the floatrow package – egreg Nov 1 '12 at 13:46
@egreg: Wow. Could you please make an answer of this so I can close this question? – krlmlr Nov 1 '12 at 13:57
You can supply a self-answer from what you build up with that package – egreg Nov 1 '12 at 13:58

Thanks to egreg for pointing me at the floatrow package. I didn't go through the entire 100+ pages manual just yet, but to me it appears that

\usepackage{floatrow}
\floatsetup[table]{style=plaintop}


in the preamble and

\begin{table}
\ttabbox
{\caption{A small table ...}\label{...}}
{\begin{tabular}...\end{tabular}}
\end{table}


will produce the table with the caption on top, just as would

\begin{table}
\caption{A small table ...}\label{...}
\begin{tabular}...\end{tabular}
\end{table}


but with the advantage that it's possible to change the location of the caption throughout the document with just one setting. Of course, the package provides many more features than just that (e.g., it can do rules with \floatsetup{style=Ruled}).

Conclusion: there's definitely no need for another package of this kind.

-