0

I wrote something like this

text
\begin{figure}
 ...
 ...
\end{figure}
\section{} or text (the problem shows up anyway)

but when I compile (with overleaf) all the text that is meant to be below the image is put above and I can't write anything. Also, if I add another line it works properly, like this

text
\begin{figure}
 ...
 ...
\end{figure}
not_useful_text
\section{} (or text, it's the same)
  • Welcome to TeX.SX! Does this help you: https://tex.stackexchange.com/a/39020/47927 ? – Jasper Habicht Jul 20 '22 at 16:52
  • Are you sure you want to be using a floating figure environment at all? – frabjous Jul 20 '22 at 16:57
  • I'm kinda new on latex, I just wanted to put the figure and explain the meaning with text below, if there is any other way it's okay. If I put [h] there are no changes. – DYLAN NICO AMBROSI Jul 20 '22 at 16:59
  • 1
    Try leaving blank line above and below the figure. – barbara beeton Jul 20 '22 at 17:43
  • 1
    the only purpose of the figure environment is to take the content out of the document flow and allow it to be placed elsewhere to help with page breaking. By default it is not allowed to stay: it always moves, you can use \begin{figure}[htbp] if you want to allow it not to move, but in general what you describe is not a problem – David Carlisle Jul 20 '22 at 18:16
  • Thanks to all of you, I solved it thanks to barbara: blank space above and below the figure. – DYLAN NICO AMBROSI Jul 21 '22 at 18:18

1 Answers1

0

I believe that you need exact image placement, if yes, try with:

\usepackage{float}

\begin{document} ... text \begin{figure}[H] ... ... \end{figure} not_useful_text \section{} (or text, it's the same) ... \end{document}

MadyYuvi
  • 13,693