[Tex/LaTex] How to have a figure with caption in multicol environment

floatsmulticol

I am having the following problem with adding a figure inside the multicol environment:

\documentclass[10pt, twoside]{book}
\usepackage{graphicx}
\usepackage{subfig}

\begin{document}

 \begin{multicols}{2}
 a test file for picture inclusion along with the captions and labeling
\begin{figure}
 \centering
 \includegraphics[width=5cma]{Cauchy_sequence_illustration-png}\\
 \caption{Lets see}\label{pinki}
\end{figure}
\end{multicols}

\begin{figure}
 \centering
  \includegraphics[width=5cm]{Cauchy_sequence_illustration-png}\\
 \caption{Lets see}\label{pinki}
\end{figure}



\end{document} 

After this while I am pressing Ctrl + Shift + X (usually I compile like this in DVI format and then clicking "dvi—>pdf" I convert it into PDF document.) the picture in multicol environment is not shown in YAP Viewer but the second one (which is outside of multicol environment) is shown along with the caption.

Kindly help me how to handle this problem. Please note that I am using the figure in .ps format. And I am not allowed to use any other format according to the instruction.

Best Answer

multicol package doesn't work well with figure environment (which is a float). You stand better chances by using the \includegraphics and add the caption using \captionof macro from caption (or \capt-of) package.

\documentclass[10pt, twoside]{book}
\usepackage[demo]{graphicx}   %%% remove demo in your file
\usepackage{multicol}
\usepackage{caption}

\begin{document}

 \begin{multicols}{2}
 a test file for picture inclusion along with the captions and labeling
{ \centering
 \includegraphics[width=\columnwidth]{Cauchy_sequence_illustration-png}\\
 \captionof{figure}{Lets see}\label{pinki}
}
\end{multicols}

\begin{figure}[htb]
 \centering
  \includegraphics[width=5cm]{Cauchy_sequence_illustration-png}\\
 \caption{Lets see}\label{pinki}
\end{figure}
\end{document}

enter image description here

Related Question