I'm using stock figure environment and \caption{} command to typeset figures in my document. Is there any sane way I can get 'Figure N' part to be written right below the figure, and the actual caption's text above it?

The obvious hack with empty caption apparently works, but for my money it seems a bit awkward.

\center{Descriptive title string goes here}

I guess some environment or command needs to be (re)defined in order to change float layout, but I have vague idea where to start from.


Since the default behaviour is to typeset the caption text and numbering together, rather than break them apart, your hack works. It may just seem awkward since you're using \caption without actually giving a caption.

To that end, you could define "more convenient" commands that would do the same:

enter image description here

\usepackage[demo]{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{caption}% http://ctan.org/pkg/caption
\captionsetup{labelsep=none,textfont=it}% Format caption settings
  \def\floattitletext{#1}% Store float title text
  \captiontextfont\strut #1\par\vskip\abovecaptionskip}
  \floattitle{Descriptive title string goes here}
  \floatnumber \label{monitor-main-window}

The above example uses the caption package to format the float captions via key-value pairs. As such, you can use these key-values to format the separate components of the caption. I've defined \floattitle{<title>} which typesets the float title using \captiontextfont (it also stores <title> for later use). It also adds a gap at below the caption that is equivalent to the gap above the "actual caption" below the image. Also \floatnumber is a duplicate of \caption{}, which typesets nothing, but adds the correct reference test so you're able to use \listoffigures and/or \listoftables. Note that the command names are general, so you can use them in either a figure or a table environment.

Finally, for correct referencing, you need to place the \label after \floatnumber (or \caption in general). See Where to put the \label on a figure environment?

graphicx with the demo option was used to be able to typeset an image image without it actually being there - replacing it by a 150pt x 100pt rectangle. Don't use the demo option otherwise.

  • Such an elaborate and prompt answer! And that's great news I'm not have to poke into redefining \@float or something. (Too bad I am not so good at language to express your esteem.) – d.a. Dec 30 '11 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.