[Tex/LaTex] Wrong display order of figures and text


Why do the figures appear BEFORE instead of AFTER the section title ???




\section*{Why is this section title BELOW the figures ???!!!}

\draw[line width=1mm,rotate=45] (0,0) rectangle (2,2);
{\caption{\footnotesize\bf Figure 1.}
\draw[line width=1mm] (0,0) circle (3);
{\caption{\footnotesize\bf Figure 2.}

The figures should appear between the section title and THIS line !!!


Best Answer

The Figure environment "floats" to find an optimal position on the page. When you begin a figure, you can use the options [htbp!] to specify whether the figure should go "here", the "top" of this page, the "bottom" of this page, or a special "page" reserved for floats. LaTeX, in its infinite wisdom, will sometimes prevent you from putting a figure in an "ugly" place, but you can (sort of) override its decision using the "!" option. When you haven't used any option, the environment assumes that you provided [tbp], and it's choosing to put the figure at the top of the page, above where your section goes. So using


should fix your problem.

Related Question