I am new in LaTeX and I am trying to insert a .pdf figure to my LaTeX code.
(I use pdflatex and my distributor is Texmaker)
I have the following code
\documentclass[11pt,a4paper,fleqn]{article}
\usepackage{amsmath,amsfonts,latexsym}
\usepackage{graphicx}
\usepackage[text={15cm,24cm},top=3cm]{geometry}
%some text here
\begin{figure}
\centering
\caption{Contour Plot for Potential Energy}
\includegraphics[width=1\textwidth]{FinalContour}
\end{figure}
%some more text
I get the figure I want in my pdf file but it is in a wrong position. It appears in a new page, the caption appears at the top of the new page but the figure appears in the middle of the page. I want it to appear exactly after the text written above the the graph. Any ideas how to fix that would be much appreciated. Thank you.
figure, i.e. LaTeX is enabled to shift the image to a position where it thinks it is best. If this is not what you want, you should use some of the parameters to figure or drop the figure environment (remove\begin{figure}...\end{figure}) and use\captionof{figure}{Contour Plot...}, in this case, use\usepackage{caption}in the preamble. Please post working examples, not fragments of code – Apr 06 '15 at 18:27