\begin{figure}
...
\caption{In this 2-dimensional model, two rays of light from a galaxy at
{\bf S} orbit the deflecting mass {\bf M} and recombine at observer
{\bf O}. The observer sees two images {\bf `S'} at locations projected
back along the geodesics.}
\label{example-fig}
\end{figure}
But that's just too easy, right? Here's some other things you can do:
\listoffigures in your source, you
get a nice List of Figures with the Figure number, its caption, and
the page it appears on. If your captions are long and complicated, this
List of Figures might stretch on for pages...You can put
different captions in the List of Figures by including
an optional argument of the \caption command:
\begin{figure}
...
... |<----- optional argument of \caption ----->|
\caption[This is what shows up in the List of Figures.]{Here is the text
that appears under the Figure itself. This text is often very long and
complicated, and is only useful when you've got the Figure sitting right
there in front of you. It won't mean much to anyone just reading the
List of Figures.}
\label{example-fig}
\end{figure}
\caption{ ...from equation (\ref{some-eqn}) we can see ... }
won't work. To quote
Jim,
LaTeX blows chunks. Who knows? Maybe you're
just asking too much! There are two ways get references (and maybe cites,
too?) inside a caption. One is a pure kludge, one works the way it's
supposed to:
The Kludge
\caption[]{ ...\ref{some-eqn}...} with empty square
brackets out front. Of course, then you can't have
different captions in the List of Figures.
The Way that Always Works
\ref's are fragile (Hey! that's
Lamport's word; it doesn't mean they always get picked last on the
ball team...) and must be protected. This property is clearly
elucidated in Lamport's manual. (That's a math "clearly" by the way, which
means "Ha! No way you can see it, you loser. I, on the other hand, have a
Ph.D.") A bunch of other things are fragile, too, mostly things
that get changed when LaTeX processes the file
the second time. Anyway, the command \protect
"protects" the very next word in the source. So to get fragile
stuff like equation references in the caption, try this:
\begin{figure}
...
\caption{The graph of the function given in (\protect \ref{some-eqn}).}
\end{figure}
Notice that to get parentheses around the number, like "(7)", the
\protect statement has to go inside the ().