0

So I've been working on my paper and latex just doesn't want to position this graphic at the place I want it to be. I also used the float package and everything I find on the internet doesn't seem to work.

my Latex code and the output

the code is:

\newpage
Die Grafik sieht dabei folgendermaßen aus:
\begin{figure}[!!h]
\begin{center}
\includegraphics[scale=0.4]{30a.png}
\end{center}
\caption{Approximation der Exponentialfunktion für zwei Summanden in der Partialsumme im Vergleich zu $\exp(x)$}
\end{figure}
Aus der Grafik wird erkenntlich, ...

The problem is that "Aus der Grafik ..." is above the picture although its below it in the code.

David Carlisle
  • 757,742
  • Welcome to TeX:SE! See if empty line between figure and followed text solve your problem. – Zarko Mar 31 '22 at 20:27
  • BTW, use \centering command in the figure environment instead of center environment because center adds additional (and maybe unwanted) space around it. – Teddy van Jerry Apr 01 '22 at 03:18
  • two ! isn't an error but is the same as !. The only reason to use figure is to allow it to be moved. Just delete \begin{figure}[!!h] and \end{figure} and the image will not move from where you place \includegraphics – David Carlisle Apr 01 '22 at 07:28
  • @DavidCarlisle but can I still caption it? – Emma Howe Apr 01 '22 at 10:40
  • 1
    you could use \captionof{figure}{...} but really the reason figures have captions is because they float... but you may prefer the [H] option as described in the duplicate question linked above. Note if you change the wording anywhere in the document so the natural position of the figure becomes half on this page and half on the next, you will get an ugly big white space and wish you had allowed figures to float as normal:-) – David Carlisle Apr 01 '22 at 10:45

0 Answers0