TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Create caption without float AND without caption-package?

i have this:


Here is the text



When i try to add \caption and \label (as in the figure) it shows me errors but the pdf i am taking is ok! Is there another way to do that?

share|improve this question

marked as duplicate by Marco Daniel, egreg, percusse, topskip, lockstep Jun 13 '12 at 22:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

The command caption works only inside float environments. If you want to use a caption outside float you need the command captionof – Marco Daniel Jun 6 '12 at 13:13
If i use \captionof it shows me error "undefined control sequence \captionof". – George Jun 6 '12 at 13:21
See the link -- you need the package caption or capt-of or a KOMA-class. – Marco Daniel Jun 6 '12 at 13:22
See also: tex.stackexchange.com/questions/49858/… – Marco Daniel Jun 6 '12 at 13:23
Ok,thank you for your help. – George Jun 6 '12 at 13:40
up vote 4 down vote accepted

To label pictures outside of a figure-environment, use the caption package with the macro captionof like this:

    Here is the text
    \captionof{figure}{A wonderful picture}
share|improve this answer

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