Latex image and text

When I write in Latex I have the following problem that I will try to explain with an example:

When I start writing I want the text to follow the following structure: Text1 Image1 Text2 Imagem2 only there is usually space left between Text1 and image1 that fits text2 and then latex automatically changes the structure to: Text1 Text2 Image1 Imagem2

How can I solve this problem so that my document follows the structure I want even with space left?

Author: João Costa, 2018-02-06

2 answers

Use the "float" package and the [H] option for your figures.

\usepackage{float}

 ...

 \begin{figure}[H] 
 \centering 
 \includegraphics{suafigura}
 \caption{Algum título} 
 \label{figxx} 
 \end{figure}
 1
Author: Robert, 2018-03-17 15:27:45

Try:

\begin{figure}[!h]
...
\end{figure}

But the result is a bit ugly...

Alternatively:

\begin{figure}[!htb]
...
\end{figure}
 0
Author: JJoao, 2018-04-23 14:09:45