# in a text and figure side by side how to add “caption” and “label” [duplicate]

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

i have this:

\begin{minipage}[b]{0.35\linewidth}

Here is the text

\end{minipage}

\hfill
\begin{minipage}[b]{0.55\linewidth}
\centering
\includegraphics[scale=0.8]{imag9}
\caption{TEXT}
\label{fig3.5}
\end{minipage}


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?

-

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

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
–  Marco Daniel Jun 6 '12 at 13:23
Ok,thank you for your help. –  George Jun 6 '12 at 13:40

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

\documentclass[11pt]{article}
\usepackage{caption}
\usepackage[draft]{graphicx}
\begin{document}
\begin{minipage}[b]{0.35\linewidth}\centering
Here is the text
\end{minipage}\hfill
\begin{minipage}[b]{0.55\linewidth}\centering
\includegraphics[width=5cm]{image}
\captionof{figure}{A wonderful picture}
\end{minipage}
\end{document}

-