5

I'm trying to include a figure and caption to show my data.

The image shows when I use \includegraphics{}, but disappears when I add \begin{figure}. I'm not getting any errors when compiling my report. I am including my figure like this:

\documentclass[a4paper,12pt]{article}
\author{~Name~}
\date{~Date~}
\title{~Title~}
\usepackage{multicol}
\setlength{\columnsep}{0.9cm}
\bibliographystyle{ieeetr}
\usepackage{setspace}
\onehalfspacing
\usepackage{geometry}
\geometry{
a4paper,
total={210mm,297mm},
left=20mm,
right=20mm,
top=20mm,
bottom=20mm
}
\usepackage{graphicx} 
\graphicspath{{images/}}
\usepackage{hyphenat}

\begin{document}
\maketitle

\begin{abstract}
~abstract~
\end{abstract}

\begin{multicols}{2}
\section{Introduction}
\nohyphens{~Intro & equations~}

\begin{figure}
\includegraphics[width=0.4\textwidth]{Fig1}
\caption{~caption~}
\end{figure}

\end{document}

Is there something I'm missing? The image is a .png file.

2

figure is a float. Floats are partially disabled inside the multicols environment. The only ones available are the starred versions e.g. figure*. However, these will be moved to the next page and occupy the full width of that page.

  • Is there any way to keep the figure on the same page? – ScC Mar 21 '15 at 0:17
  • @ScC As in your question, use \includegraphics{} without the figure environment. Or don't use multicols. Otherwise, no. (Not without rewriting the package, which may mean rewriting LaTeX's output routine. At least, so the package documentation suggests.) – cfr Mar 21 '15 at 0:20

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.