Maintaining figures in LaTeX documents can be a challenging task, but it can be done with a few helpful tips. Here is how to keep your figures in place:
Include the \usepackage{float} command in the preamble for your document. This package allows you to set the position of the floats (tables, figures, captions, etc.).
When you include floating elements, you can use the H, t, b, or p placement options with the \begin{figure} command.
• H places it exactly where you put the figure environment
• t (top) places it at the top of the page
• b (bottom) places it at the bottom of the page
• p (page) places it on the current page, provided that you have enough space.
You can also use the \begin{figure}[htbp] command to get a specific placement.
Check the official documentation of the float package at https://www.ctan.org/pkg/float to know more options regarding the figure placement.
By following these tips and the official documentation mentioned above, you should be able to keep your figures in place in LaTeX.