is there a way to control the caption format used for figures, depending on where the figure has been placed? In particular, i would like to have different formatting of figure captions for figures that are placed to the top, and figures that are placed on the bottom of a page.
In my MWE i define a format that uses a horizontal line under the caption text. This is ok if the figure is on the top of the page and the caption is below the figure. But when the figure is at the bottom, i would put the caption above the figure - and then i'd like to use a caption format that has the horizontal line above the text.
Do you think something like that is possible, even automatically?
Cheers Janos
P.s. in order to compile my MWE, you'd need an image called "blackbox".
\documentclass{article}
\usepackage[pdftex]{graphicx}
\usepackage{caption}
\usepackage{lipsum}
\DeclareCaptionFormat{figureFormat}{#1#2#3\hrulefill}
\captionsetup[figure]{format=figureFormat}
\begin{document}
\begin{figure}[!t]
\centering
\label{fig:1}
\includegraphics[width=\columnwidth]{blackbox}
\caption{This figure is on the top. The caption should be on the bottom,
and the horizontal line under it.}
\end{figure}
\lipsum[1]
\lipsum[1]
\begin{figure}[!b]
\centering
\caption{This figure is on the bottom, so it caption is above it. Now
the horizontal line should be also above this text...}
\label{fig:2}
\includegraphics[width=\columnwidth]{blackbox}
\end{figure}
\end{document}
\topfigrule
and\botfigrule
which place rules (or whatever) below or above (respectively) a top or bottom placed figure. But since the float is put in a box and then placed, there is no way AFAIK to change the placement of the caption dependent on the placement of the float.