I want to add an image to my paper but I have a problem.
When I add the image with just \includegraphics[]{} tag, everything works fine, and the picture shows up when I compile my document.
When I use \begin{figure} \includegraphics[]{} \end{figure} - syntax the image does not appear in the compiled document.
The relevant part of my header include is :
\usepackage{graphicx}
\graphicspath{ {pics/} }
And later on I add the image with this block:
%This does not work
\begin{figure}
\centering
\includegraphics[width=.4\textwidth]{generalPolya}
\label{generalPolya}
\end{figure}
%This works
\includegraphics[width=.4\textwidth]{generalPolya}
I guess it's some sort of issue in the graphics package, but I've copied the setup from a previous paper I had, so it should work. Any ideas on what's wrong? Thanks in advance.
Edit:
Thanks for all the responses. I created a minimal working example. Apparently multicols messes with the figure tag:
\documentclass[]{article}
\usepackage{multicol} % Used for the two-column layout of the document
\usepackage{amsmath}
\usepackage{graphicx}
\graphicspath{ {pics/} }
\title{\vspace{-15mm}\fontsize{24pt}{10pt}\selectfont\textbf{Lorem ipsum}} % Article title
\begin{document}
\maketitle % Insert title
\begin{multicols}{2} %
%This does not show up
\begin{figure}[h]
\includegraphics[width=.4\textwidth]{generalPolya}
\end{figure}
%This shows up.
\begin{center}
\includegraphics[width=.5\textwidth]{chair}
\end{center}
\end{multicols}
\end{document}
What shows up after compiling the document is this

What is wrong with this syntax?


\documentclass{...}and ending with\end{document}. – Jul 14 '15 at 07:32\labelin the first code snippet is of no use, since it does not generate a label for your figure -- you have to use\captionfor a\labelto be effective there. Here you generate a label for the last counter incremented outside of thefigureenvironment, e.g. achaptercounter – Jul 14 '15 at 07:33\begin{figure}[htbp]as the default (\begin{figure}) is the same as\begin{figure}[tbp]note noh(rememberhdoes not mean HERE, it means here about) – daleif Jul 14 '15 at 07:35\begin{figure}[htbp]but it does not work. There is no floating, I checked the whole document. I tried to recreate a minimal working example as you said but there it works, so I guess it has to do with some conflict in my environment headers. I think I'll just keep on adding packages until I isolate the one that causes the issue – Panagiotis Chatzichristodoulou Jul 14 '15 at 07:48multicolsdisables the figure environment, such that nothing shows up – Jul 14 '15 at 08:38