How to Put an Image Before the References in LaTeX
At a glance
- 1. Place the figure first
Put the figure environment in the source before the bibliography or references section.
- 2. Add a float barrier
Insert FloatBarrier immediately before the references to stop earlier figures from moving past that point.
- 3. Use a page break if needed
Choose clearpage instead when you want all pending floats printed and the references to start on a new page.
A figure in LaTeX is a float: LaTeX may move it to improve page layout, so its position in the source does not guarantee its position on the page. If a figure appears after the references, it has probably been deferred while LaTeX searched for a suitable place.
The usual fix is to put the figure before the bibliography in the source and place a float barrier between them. This keeps the figure before the references without forcing a page break.
Use a float barrier before the references
The placeins package provides \FloatBarrier. It prevents floats declared before the barrier from moving past it. Add the command immediately before your bibliography or reference list:
\usepackage{placeins} % in the preamble
% ... figure environment appears earlier in the document ...
\FloatBarrier
\bibliographystyle{plain}
\bibliography{references}
With biblatex, the same placement works before \printbibliography:
\FloatBarrier
\printbibliography
The barrier does not pin the figure to the exact spot where it is written. It makes LaTeX deal with the earlier pending floats before it proceeds beyond the boundary. Depending on the available space and the figure’s size, LaTeX may place the figure at the top or bottom of a page, or on a float page—but it will not let that earlier figure drift into the references section.
Complete example
This example uses the mwe package, which provides a sample image named example-image. Replace that file name with your own image if needed.
\documentclass{article}
\usepackage{graphicx}
\usepackage{placeins}
\usepackage{mwe} % provides example-image
\begin{document}
\section{Results}
The image is part of the results section.
\begin{figure}[htbp]
\centering
\includegraphics[width=0.7\linewidth]{example-image}
\caption{A sample image.}
\label{fig:sample}
\end{figure}
See Figure~\ref{fig:sample} for an example.
\FloatBarrier
\begin{thebibliography}{9}
\bibitem{sample}
A. Author,
\emph{A Sample Book},
Example Press, 2024.
\end{thebibliography}
\end{document}
The figure environment appears before the bibliography, and \FloatBarrier marks the boundary. The placement option [htbp] asks LaTeX to try the current position, the top or bottom of a page, or a float page. It is a set of placement preferences, not a guarantee that the figure will stay exactly there.
When to use \clearpage
Use \clearpage if you want the references to start on a new page and need all pending floats printed first:
\clearpage
\bibliography{references}
Unlike \FloatBarrier, \clearpage ends the current page and starts another one after flushing pending floats. This is useful when a page break is acceptable, but can create more whitespace or an extra page. If you only need to keep floats out of the references, \FloatBarrier is usually the less disruptive choice.
When to use [H]
If the image must appear right at a particular point in the text, the float package provides the [H] placement option:
\usepackage{float}
\begin{figure}[H]
\centering
\includegraphics[width=0.7\linewidth]{my-image}
\caption{A figure placed here.}
\end{figure}
[H] makes the figure non-floating, so LaTeX places it at that point in the document rather than treating it as a float. It is not the best default: a large figure may leave awkward gaps or force a page break. If your main goal is simply to ensure that figures come before the references, a barrier is generally preferable.
Common mistakes
- Putting the figure after the bibliography in the source. A barrier cannot move a later figure earlier. Move the whole figure environment before the bibliography, then add the barrier at the boundary.
- Expecting
[h]or[htbp]to mean “exactly here.” These options express placement preferences. LaTeX can defer a float when the page layout does not allow the requested placement. - Adding
\FloatBarrierafter the bibliography. The barrier must come before the references; otherwise, it cannot stop earlier figures from crossing into them. - Using
\clearpagewhen no page break is wanted. It flushes floats but also starts a new page. Choose\FloatBarrierwhen you only need to constrain float placement. - Forgetting the package. Add
\usepackage{placeins}in the preamble before using\FloatBarrier, or\usepackage{float}before using[H].
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.