# Different captions for float and non float figures

I use following code for nonfloat figures..

\begin{minipage}[c]{\textwidth}
\centering
\includegraphics[width=3.0in]{myimage.eps}
\captionof{figure}{Caption for image}
\label{fig:sample_figure}
\end{minipage}


I want caption as

Caption for image

and for float figures

   \begin{figure}
\includegraphics[width=3.0in]{myimage.eps}
\caption{Caption for image}
\label{fig:sample_figure2}
\end{figure}


Here i want caption as

Figure 1.1 Caption for image

How to achieve this?

-
Instead of using captionof{figure} you can define a new float-environment with your request style definition and then using captionof with this new environment name. So the counter is independently. BTW: A small MWE is useful. –  Marco Daniel Mar 2 '13 at 10:49
Do you not want to count the non-floats? (It seems so from your example.) If so, can't you just not use \captionof at all, but write the caption directly? –  Torbjørn T. Mar 2 '13 at 10:51
yes I do not want to count non-floats –  sandu Mar 2 '13 at 10:52
@sandu: Do you want an entry in the list of figures? –  Marco Daniel Mar 2 '13 at 10:56

To get an unnumbered caption you can use the starred version of the command \captionof. Please note that the starred version doesn't provide an entry in the list of ...

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{caption}
\usepackage{mwe}

\begin{document}
\listoffigures
\section{foo}
\blindtext

\begin{minipage}[c]{\textwidth}
\centering
\includegraphics[width=3.0in]{example-image-a}
\captionof*{figure}{Caption for image}
\label{fig:sample_figure}
\end{minipage}

\blindtext

\begin{figure}
\includegraphics[width=3.0in]{example-image-b}
\caption{Caption for image}
\label{fig:sample_figure2}
\end{figure}

\blindtext

\end{document}

-