I am trying to get two figures next to eachother withing some writing, and LaTeX keeps moving one underneath to the next page. This is my code:



shelo efeoeignregvrmbkr bkmtbpgk bgk bkgbg \\ \\



  • Welcome to TeX.SX! Of course LaTeX does this way, since they float away
    – user31729
    Mar 15, 2015 at 11:23
  • Using an option [h] greatly increases the chance that the float will go to the end of the document. Normally latex warns and changes it to [ht] to give itself a chance. [h] means not at top of page, not at bottom of a page and not on a float page, which means that the float is allowed almost nowhere. Mar 15, 2015 at 11:34

1 Answer 1


Unless you're working with an unusually wide paper size (or if the page margins are unusually narrow), fitting two 8cm-wide images next to each other simply isn't feasible. Instead of specifying an absolute width for the images, I suggest you select a relative width, such as 0.45\textwidth. Doing so will leave some whitespace -- in the amount of 0.1\textwidth -- between the images.

The horizontal line in the screenshot below is there just to illustrate the width of the text block.

enter image description here

\usepackage[demo]{graphicx} % omit 'demo' option in real document
\hrule  % just to illustrate width of text block
\caption{p=} \label{SIRp2}
shelo efeoeignregvrmbkr bkmtbpgk bgk bkgbg


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .