7

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.

7

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

  • WOW!! That really worked. Thank you so much sir. – Anjan3 Sep 1 '14 at 6:27
  • Dear Sir, Two more doubts I have. Will you please help me ? 1) How to put entire figure in a box? 2)How to adjust two figures side by side , not by up-down ? – Anjan3 Sep 1 '14 at 6:37
  • @AnjanDebnath For box, use \fbox{\includegraphics[width=\columnwidth]{Cauchy_sequence_illustration-png}} and for putting them side by side, you may put the second figure inside the multicols environment. It will be better, if you post a new question with more details on your requirements. – user11232 Sep 1 '14 at 6:40
  • Sir, I have post my situation here tex.stackexchange.com/questions/198892/… – Anjan3 Sep 1 '14 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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