# Insert an image before another already cited

I know is not the best, but I'd like to display an image before another already referred. I mean I'd like to cite image 2 before image 1 but display them in the correct order. This is becasue image 1 is very small and I want to display it at the top (or bottom of the page) while image 2 is very big and is iserted in its own page.

LaTeX correctly display images in the order I recall them in the text, but I'd like to avoid this, but only for these two images.

E.g.

Text text text see Image 2. Text text text see Image 1.

Display image 1 in the same page (top or bottom).

Newpage with image 2.

How can I do this?

Thankyou!

• Of course I tryed with [h!] but is not effective. – Stefano_g Aug 7 '13 at 14:36

This works. But don't do this.

\documentclass{article}
\usepackage{graphicx}
\begin{document}
Text text text see Image~\ref{fig:B}. Text text text see Image~\ref{fig:A}.
\begin{figure}[htb]
\centering
\includegraphics[width=4in]{example-image-a}
\caption{Caption here}
\label{fig:A}
\end{figure}
%\clearpage  %% uncomment if needed to shipout all floats before this point.
\begin{figure}[htb]
\centering
\includegraphics[width=4in]{example-image-b}
\caption{Caption here}
\label{fig:B}
\end{figure}
\end{document}


This can easily be resolved by using the float package in conjunction with the parameter [H]:

\documentclass{article}
\usepackage{float}

\begin{document}

\begin{figure}[H]
...picture code...
\label{fig:figA}
\end{figure}

\begin{figure}[H]
...picture code...
\label{fig:figB}
\end{figure}

\end{document}


By using the [H] option the figure will appear exactly where you put the code. So you can define the order manually.