How can I get the figures not to be pushed to the end of the document?

Your figures are most likely too large and/or you tell LaTeX to place them at a position where they don't fit. So they are are pushed to the last position were they finally do: the end of the document.

Adding restrictions like [t] (top) or [h] (here, LaTeX has a habit of refusing it) doesn't help, but makes things worse! Actually removing all of that restrictions might help. There is a good reason why this argument to figure is optional! If you are using it add at least p so LaTeX can do float-only pages.

To fix this you can allow more space for floats (figure and table) alike by redefining one or more of the following macros. The ...fraction ones define the fraction of the page with is allowed to be used on top or bottom etc. The ...number ones define the maximum number of floats at these positions. The values below are examples from this TeX FAQ.

\renewcommand{\topfraction}{.85}
\renewcommand{\bottomfraction}{.7}
\renewcommand{\textfraction}{.15}
\renewcommand{\floatpagefraction}{.66}
\renewcommand{\dbltopfraction}{.66}
\renewcommand{\dblfloatpagefraction}{.66}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}

I wouldn't recommend to change your figures to non-floating ones because this gives bad layout.


Note that this has been mentioned in a few places already. Here is a summary:

If you really want them to stay in place, you could just not put them in Floats. Then you can use either the caption or the capt-of package to add a caption to the figure.

However, I think that the most accepted method is to use the placeins package to have your floats placed in the section they appear in. You can also define \FloatBarriers to decide where floats should not go past.

Playing with the size of the figure, even for a couple of points, can also make a great difference in the placement while not changing much of the visual aspect.


Start with appropriate placement parameters for your float objects.

\begin{figure}[!ht]
% figure content
\end{figure}

The exclamation mark overwrites the internal values introduced by Martin and makes LaTeX "try harder" to place the float at the earliest possible place. It is documented in Appendix C.9 of the Lamport book.