I have a MWE as given below:
/*Packages that are being used
...
...
*/
\chapter{...}
\section{...}
\paragraph{...}
\section{...}
...
\section{...}
\paragraph{...}
(some text)
\begin{figure}
\includegraphics[scale=0.675,angle=90]{filename}
\caption[reference]{caption}
\end{figure}
\section{...}
\paragraph{...}
Instead of appearing in the place I expected in the middle of the text, my figure ends up at the end of the chapter after the last paragraph. How could I solve this?
Following suggestions I tried
\begin{figure}[h], \begin{figure}[ht] and \begin{figure}[htbp] but figure still goes to the end of chapter.
Solved using \usepackage{float} and \begin{figure}[H], as suggested in How to influence the position of float environments like figure and table in LaTeX?
\includegraphicsincludes the image, the purpose of thefigureenvironment is to take the content out of the document flow and allow it to be inserted elsewhere to help with page breaking. By default leaving it in place isn't allowed but you can use\begin{figure}[htbp]to allow it to stay in place if it fits. – David Carlisle Jun 10 '21 at 08:16\begin{figure}. Like this:\begin{figure}[H]. To do that you should also add a new package called\usepackage{float}. Anyway, further information can be seen here. – Onur Gürdoğan Jun 10 '21 at 08:16\paragraphis a fourth level heading and should be used below\subsubsectionnot below\section– David Carlisle Jun 10 '21 at 08:17Hspecifier has its usages, this is not one of them – daleif Jun 10 '21 at 09:08