I am trying to insert an image in the middle of the page, but it is going to the top of the page. why the hell is it happening?

I tried this:


I am looking for solution for 2 hours, not a single sign of success!


The only purpose of the figure environment is to allow LaTeX to move the figure, and a minipage inside figure has no purpose at all unless you have footnotes, so you just need

% \begin{minipage}{\textwidth}
%  \end{minipage}

and the image will appear wherever you have \includegraphics in the source.

Note the rules for placing images are the same as the rules for placing X Normally if you enter X it comes where you put it, either part of the current line, or perhaps indented at start of a paragraph. If you do


Then the X will float and be positioned by the page breaking routines. \includegraphics works in exactly the same way, or said more correctly, the float placement routines have no information about the content of the figure environment.


Figure is an floating object and minipage is not, so by encapsulating a minipage in a figure object you make the minipage floating.

Another option is using the "H" position specifier; http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions

That being said, I prefer to let LaTeX control the position of the image and use a reference to that figure in your text. Letting LaTeX control the position of all elements of your page is in my option a more robust and neat solution.

  • 4
    If you put a figure inside a minipage you will get a syntax error and the float will be discarded. – David Carlisle Apr 7 '14 at 16:29
  • you are absolutely right, I updated my answer – Robert Apr 7 '14 at 20:28

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