# How do I split images by section?

I'm currently writing my thesis and I'm trying to split several images under different sections.

For some reason, the images dont appear under the correct sections and instead are just placed on the page one after the other.

I wasnt sure how to reproduce a proper MWE as it relies on using my images. I have used placeholders where my images would normally be.

Please see the below MWE I have put together as an example (hope this is ok):

\documentclass[10pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{ {YourGraphicsPath/} }
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\section{Section 1}

\begin{figure}[h]
\centering
\caption{Test}
\label{fig:Test}
\end{figure}

\section{Section 2}

\begin{figure}[h]
\centering
\caption{Test}
\label{fig:Test}
\end{figure}

\begin{figure}[h]
\centering
\caption{Test}
\label{fig:Test}
\end{figure}

\section{Section 3}

\begin{figure}[h]

• figure (and table) are floating environments which means they not necessarily appear in the pdf exactly where you pleaced them in the input. You can influence the positioning of floats (See How to influence the position of float environments like figure and table in LaTeX?). – leandriis Mar 25 at 11:02
• If you absolutely do not want images to float but need a caption nevertheless (however, be warned about large white spaces if an image does not fit onto the remainder of a page), you can use \captionof{figure}{...} (or \captionof{table}{...}) to add captions to images and tabulars outside of figure od table environments. – leandriis Mar 25 at 11:02
• As a tip: You can always use \includegraphicx{example-image} to prepare a MWE. – leandriis Mar 25 at 11:06
• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Alessandro Cuttin Mar 25 at 11:36