0

I have two images that should be under a section but it glitches back for some reason. Here is the code

\section{Resultat}
Huvudet från hammaren placerades i den mindre skålet medan stenen och keramiken placerades i bunkarna efter att de hade värmts upp tillräckligt vid 100 grader. Temperaturen mättes någon minut efter när föremålen hade placerats i det svalna vattnet. 
\subsection{Stenen}
Bunken med 600 ml vatten som stenen placerades i har massan 
\begin{equation}
    m_w1=\rho\cdot V_s=997\cdot 600\cdot 10^{-6}=\unit[0,5982]{kg}.
\end{equation}
Temperaturen för vattnet innan de stenen placerades i bunken ocg efter visas i figur 1.

\begin{figure}% \centering \subfloat[\centering Termometern visar cirka 17,5 grader Celcius.]{{\includegraphics[width=5cm]{sten efter.jpeg} }}% \qquad \subfloat[\centering Termometern visar cirka 17,5 grader Celcius.]{{\includegraphics[width=5cm]{sten innan.jpeg} }}% \caption{Bilderna visar vattnets temperaturskillnad efter att stenen hade placerats i bunken.}% \label{fig:example}% \end{figure}

It shows up like this enter image description here

As you can see, it should appear under the subsection ''Stenen'' but instead it appears under ''Materiel''.

Ingmar
  • 6,690
  • 5
  • 26
  • 47
Muhashka
  • 153
  • 1
    The figure environmet places the figures where they fit best. If you want them placed exactly where you want, use package caption for entries in the list of figures and omitt the figure environment. – Harald Lichtenstein Mar 01 '21 at 22:18
  • 1
    The second (briefer) answer may be more useful to you. The other thing to note is that {figure} has an optional argument [tbh], which means "top, bottom, or here, whichever TeX thinks best. So you could try \begin{figure}[h], but TeX may still decide to float it elsewhere in that case. – Teepeemm Mar 01 '21 at 22:19
  • Thank you it solved the problem! And thank you guys who replied aswell!! – Muhashka Mar 01 '21 at 22:22

0 Answers0